* nsterm.m (syms_of_nsterm): ns-use-fullscreen-animation is new.
(toggleFullScreen:): Use ns-use-fullscreen-animation for animate.
+ (ns_select, ns_read_socket): Use unwind_protect to decrease
+ apploopnr (Bug#18345).
* macfont.m: Fix indentation and import changes from macport
24.3.94.
}
#endif /* NS_IMPL_COCOA) && >= MAC_OS_X_VERSION_10_5 */
+static void
+unwind_apploopnr (Lisp_Object not_used)
+{
+ --apploopnr;
+ n_emacs_events_pending = 0;
+ ns_finish_events ();
+ q_event_ptr = NULL;
+}
+
static int
ns_read_socket (struct terminal *terminal, struct input_event *hold_quit)
/* --------------------------------------------------------------------------
}
else
{
+ ptrdiff_t specpdl_count = SPECPDL_INDEX ();
/* Run and wait for events. We must always send one NX_APPDEFINED event
to ourself, otherwise [NXApp run] will never exit. */
send_appdefined = YES;
{
emacs_abort ();
}
+ record_unwind_protect (unwind_apploopnr, Qt);
[NSApp run];
- --apploopnr;
+ unbind_to (specpdl_count, Qnil); /* calls unwind_apploopnr */
}
nevents = n_emacs_events_pending;
{
emacs_abort ();
}
- [NSApp run];
- --apploopnr;
+
+ {
+ ptrdiff_t specpdl_count = SPECPDL_INDEX ();
+ record_unwind_protect (unwind_apploopnr, Qt);
+ [NSApp run];
+ unbind_to (specpdl_count, Qnil); /* calls unwind_apploopnr */
+ }
+
ns_finish_events ();
if (nr > 0 && readfds)
{