From c96169a0b1f1725f42ad0e2958599d2fd2929ec6 Mon Sep 17 00:00:00 2001 From: Adrian Robert Date: Wed, 4 Feb 2009 11:31:28 +0000 Subject: * nsmenu.m (pop_down_menu): New function. (ns_popup_dialog): Call it on unwind. (EmacsDialogPanel-runDialogAt:): Check popup_activated_flag and call timer_check() (Bug#2154). (EmacsMenu-menuNeedsUpdate:): Don't call ns_update_menu if handling_signal is set. (EmacsMenu-fillWithWidgetValue:): Set submenu title. * s/darwin.h: Same and NO_SOCK_SIGIO as well. * nsterm.m (ns_read_socket): Same and don't set handling_signal. * keyboard.c (poll_for_input_1, handle_async_input): Set handling_signal under HAVE_NS. --- src/keyboard.c | 19 +++++++++++++++++-- 1 file changed, 17 insertions(+), 2 deletions(-) (limited to 'src/keyboard.c') diff --git a/src/keyboard.c b/src/keyboard.c index e5d0896100..8b411fdac8 100644 --- a/src/keyboard.c +++ b/src/keyboard.c @@ -2182,16 +2182,24 @@ struct atimer *poll_timer; #ifdef POLL_FOR_INPUT -/* Poll for input, so what we catch a C-g if it comes in. This +/* Poll for input, so that we catch a C-g if it comes in. This function is called from x_make_frame_visible, see comment there. */ void poll_for_input_1 () { +/* Tell ns_read_socket() it is being called asynchronously so it can avoid + doing anything dangerous. */ +#ifdef HAVE_NS + ++handling_signal; +#endif if (interrupt_input_blocked == 0 && !waiting_for_input) read_avail_input (0); +#ifdef HAVE_NS + --handling_signal; +#endif } /* Timer callback function for poll_timer. TIMER is equal to @@ -7276,7 +7284,11 @@ handle_async_input () #ifdef SYNC_INPUT pending_signals = pending_atimers; #endif - +/* Tell ns_read_socket() it is being called asynchronously so it can avoid + doing anything dangerous. */ +#ifdef HAVE_NS + ++handling_signal; +#endif while (1) { int nread; @@ -7287,6 +7299,9 @@ handle_async_input () if (nread <= 0) break; } +#ifdef HAVE_NS + --handling_signal; +#endif } void -- cgit v1.2.3