Mercurial > emacs
comparison src/keyboard.c @ 101797:2dad5b4d31d5
* 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.
author | Adrian Robert <Adrian.B.Robert@gmail.com> |
---|---|
date | Wed, 04 Feb 2009 11:31:28 +0000 |
parents | 90b1877630e7 |
children | 82f3d6b4d8c1 |
comparison
equal
deleted
inserted
replaced
101796:0dd7b7766a85 | 101797:2dad5b4d31d5 |
---|---|
2180 struct atimer *poll_timer; | 2180 struct atimer *poll_timer; |
2181 | 2181 |
2182 | 2182 |
2183 #ifdef POLL_FOR_INPUT | 2183 #ifdef POLL_FOR_INPUT |
2184 | 2184 |
2185 /* Poll for input, so what we catch a C-g if it comes in. This | 2185 /* Poll for input, so that we catch a C-g if it comes in. This |
2186 function is called from x_make_frame_visible, see comment | 2186 function is called from x_make_frame_visible, see comment |
2187 there. */ | 2187 there. */ |
2188 | 2188 |
2189 void | 2189 void |
2190 poll_for_input_1 () | 2190 poll_for_input_1 () |
2191 { | 2191 { |
2192 /* Tell ns_read_socket() it is being called asynchronously so it can avoid | |
2193 doing anything dangerous. */ | |
2194 #ifdef HAVE_NS | |
2195 ++handling_signal; | |
2196 #endif | |
2192 if (interrupt_input_blocked == 0 | 2197 if (interrupt_input_blocked == 0 |
2193 && !waiting_for_input) | 2198 && !waiting_for_input) |
2194 read_avail_input (0); | 2199 read_avail_input (0); |
2200 #ifdef HAVE_NS | |
2201 --handling_signal; | |
2202 #endif | |
2195 } | 2203 } |
2196 | 2204 |
2197 /* Timer callback function for poll_timer. TIMER is equal to | 2205 /* Timer callback function for poll_timer. TIMER is equal to |
2198 poll_timer. */ | 2206 poll_timer. */ |
2199 | 2207 |
7274 { | 7282 { |
7275 interrupt_input_pending = 0; | 7283 interrupt_input_pending = 0; |
7276 #ifdef SYNC_INPUT | 7284 #ifdef SYNC_INPUT |
7277 pending_signals = pending_atimers; | 7285 pending_signals = pending_atimers; |
7278 #endif | 7286 #endif |
7279 | 7287 /* Tell ns_read_socket() it is being called asynchronously so it can avoid |
7288 doing anything dangerous. */ | |
7289 #ifdef HAVE_NS | |
7290 ++handling_signal; | |
7291 #endif | |
7280 while (1) | 7292 while (1) |
7281 { | 7293 { |
7282 int nread; | 7294 int nread; |
7283 nread = read_avail_input (1); | 7295 nread = read_avail_input (1); |
7284 /* -1 means it's not ok to read the input now. | 7296 /* -1 means it's not ok to read the input now. |
7285 UNBLOCK_INPUT will read it later; now, avoid infinite loop. | 7297 UNBLOCK_INPUT will read it later; now, avoid infinite loop. |
7286 0 means there was no keyboard input available. */ | 7298 0 means there was no keyboard input available. */ |
7287 if (nread <= 0) | 7299 if (nread <= 0) |
7288 break; | 7300 break; |
7289 } | 7301 } |
7302 #ifdef HAVE_NS | |
7303 --handling_signal; | |
7304 #endif | |
7290 } | 7305 } |
7291 | 7306 |
7292 void | 7307 void |
7293 process_pending_signals () | 7308 process_pending_signals () |
7294 { | 7309 { |