diff options
| author | Adrian Robert | 2009-02-01 16:32:26 +0000 |
|---|---|---|
| committer | Adrian Robert | 2009-02-01 16:32:26 +0000 |
| commit | 8ad093db016b77a82e7cf7a78e52e812b82442ff (patch) | |
| tree | 17917ba71544e4776c0fb6b02361d8771a212301 /src | |
| parent | 8d5b8982069c803ab1546d290fe28332612bfc9e (diff) | |
| download | emacs-8ad093db016b77a82e7cf7a78e52e812b82442ff.tar.gz emacs-8ad093db016b77a82e7cf7a78e52e812b82442ff.zip | |
* nsterm.m (ns_read_socket): Copy 2009-01-29 and 2009-01-30
XT,w32read_socket changes to ns_read_socket.
* keyboard.c (handle_interrupt): Don't call
quit_throw_to_read_char() under NS.
* blockinput.h: Remove NS-specific code.
Diffstat (limited to 'src')
| -rw-r--r-- | src/ChangeLog | 8 | ||||
| -rw-r--r-- | src/blockinput.h | 11 | ||||
| -rw-r--r-- | src/keyboard.c | 11 | ||||
| -rw-r--r-- | src/nsterm.m | 34 |
4 files changed, 41 insertions, 23 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 0fb12db1707..5ff301544bd 100644 --- a/src/ChangeLog +++ b/src/ChangeLog | |||
| @@ -1,3 +1,11 @@ | |||
| 1 | 2009-02-01 Adrian Robert <Adrian.B.Robert@gmail.com> | ||
| 2 | |||
| 3 | * nsterm.m (ns_read_socket): Copy 2009-01-29 and 2009-01-30 | ||
| 4 | XT,w32read_socket changes to ns_read_socket. | ||
| 5 | * keyboard.c (handle_interrupt): Don't call | ||
| 6 | quit_throw_to_read_char() under NS. | ||
| 7 | * blockinput.h: Remove NS-specific code. | ||
| 8 | |||
| 1 | 2009-01-30 Dan Nicolaescu <dann@ics.uci.edu> | 9 | 2009-01-30 Dan Nicolaescu <dann@ics.uci.edu> |
| 2 | 10 | ||
| 3 | * dispnew.c (window_change_signal): Don't try to get the size of a | 11 | * dispnew.c (window_change_signal): Don't try to get the size of a |
diff --git a/src/blockinput.h b/src/blockinput.h index 2eed268f8e5..4b1270110d6 100644 --- a/src/blockinput.h +++ b/src/blockinput.h | |||
| @@ -59,15 +59,6 @@ extern int interrupt_input_pending; | |||
| 59 | 59 | ||
| 60 | extern int pending_atimers; | 60 | extern int pending_atimers; |
| 61 | 61 | ||
| 62 | #if defined (HAVE_NS) && !defined (COCOA_EXPERIMENTAL_CTRL_G) | ||
| 63 | /* NS does not use interrupt-driven input processing (yet), so this is | ||
| 64 | unneeded and moreover was causing problems. */ | ||
| 65 | #define BLOCK_INPUT | ||
| 66 | #define UNBLOCK_INPUT | ||
| 67 | #define TOTALLY_UNBLOCK_INPUT | ||
| 68 | #define UNBLOCK_INPUT_TO(LEVEL) | ||
| 69 | |||
| 70 | #else | ||
| 71 | 62 | ||
| 72 | /* Begin critical section. */ | 63 | /* Begin critical section. */ |
| 73 | #define BLOCK_INPUT (interrupt_input_blocked++) | 64 | #define BLOCK_INPUT (interrupt_input_blocked++) |
| @@ -125,8 +116,6 @@ extern int pending_atimers; | |||
| 125 | } \ | 116 | } \ |
| 126 | while (0) | 117 | while (0) |
| 127 | 118 | ||
| 128 | #endif /* defined HAVE_NS && !defined COCOA_EXPERIMENTAL_CTRL_G */ | ||
| 129 | |||
| 130 | #define UNBLOCK_INPUT_RESIGNAL UNBLOCK_INPUT | 119 | #define UNBLOCK_INPUT_RESIGNAL UNBLOCK_INPUT |
| 131 | 120 | ||
| 132 | /* In critical section ? */ | 121 | /* In critical section ? */ |
diff --git a/src/keyboard.c b/src/keyboard.c index f3ebf9fdc96..e5d08961001 100644 --- a/src/keyboard.c +++ b/src/keyboard.c | |||
| @@ -11125,8 +11125,17 @@ handle_interrupt () | |||
| 11125 | Vquit_flag = Qt; | 11125 | Vquit_flag = Qt; |
| 11126 | } | 11126 | } |
| 11127 | 11127 | ||
| 11128 | /* TODO: The longjmp in this call throws the NS event loop integration off, | ||
| 11129 | and it seems to do fine without this. Probably some attention | ||
| 11130 | needs to be paid to the setting of waiting_for_input in | ||
| 11131 | wait_reading_process_output() under HAVE_NS because of the call | ||
| 11132 | to ns_select there (needed because otherwise events aren't picked up | ||
| 11133 | outside of polling since we don't get SIGIO like X and we don't have a | ||
| 11134 | separate event loop thread like W32. */ | ||
| 11135 | #ifndef HAVE_NS | ||
| 11128 | if (waiting_for_input && !echoing) | 11136 | if (waiting_for_input && !echoing) |
| 11129 | quit_throw_to_read_char (); | 11137 | quit_throw_to_read_char (); |
| 11138 | #endif | ||
| 11130 | } | 11139 | } |
| 11131 | 11140 | ||
| 11132 | /* Handle a C-g by making read_char return C-g. */ | 11141 | /* Handle a C-g by making read_char return C-g. */ |
| @@ -11183,7 +11192,7 @@ See also `current-input-mode'. */) | |||
| 11183 | #endif /* NO_SOCK_SIGIO */ | 11192 | #endif /* NO_SOCK_SIGIO */ |
| 11184 | } | 11193 | } |
| 11185 | else | 11194 | else |
| 11186 | #endif | 11195 | #endif /* HAVE_X_WINDOWS */ |
| 11187 | new_interrupt_input = !NILP (interrupt); | 11196 | new_interrupt_input = !NILP (interrupt); |
| 11188 | #else /* not SIGIO */ | 11197 | #else /* not SIGIO */ |
| 11189 | new_interrupt_input = 0; | 11198 | new_interrupt_input = 0; |
diff --git a/src/nsterm.m b/src/nsterm.m index f41aeee2c93..b9902fbe774 100644 --- a/src/nsterm.m +++ b/src/nsterm.m | |||
| @@ -3131,15 +3131,22 @@ ns_read_socket (struct terminal *terminal, int expected, | |||
| 3131 | struct input_event ev; | 3131 | struct input_event ev; |
| 3132 | int nevents; | 3132 | int nevents; |
| 3133 | static NSDate *lastCheck = nil; | 3133 | static NSDate *lastCheck = nil; |
| 3134 | |||
| 3134 | /* NSTRACE (ns_read_socket); */ | 3135 | /* NSTRACE (ns_read_socket); */ |
| 3135 | 3136 | ||
| 3136 | if (interrupt_input_blocked) | 3137 | if (interrupt_input_blocked) |
| 3137 | { | 3138 | { |
| 3138 | interrupt_input_pending = 1; | 3139 | interrupt_input_pending = 1; |
| 3140 | #ifdef SYNC_INPUT | ||
| 3141 | pending_signals = 1; | ||
| 3142 | #endif | ||
| 3139 | return -1; | 3143 | return -1; |
| 3140 | } | 3144 | } |
| 3141 | 3145 | ||
| 3142 | interrupt_input_pending = 0; | 3146 | interrupt_input_pending = 0; |
| 3147 | #ifdef SYNC_INPUT | ||
| 3148 | pending_signals = pending_atimers; | ||
| 3149 | #endif | ||
| 3143 | BLOCK_INPUT; | 3150 | BLOCK_INPUT; |
| 3144 | 3151 | ||
| 3145 | #ifdef COCOA_EXPERIMENTAL_CTRL_G | 3152 | #ifdef COCOA_EXPERIMENTAL_CTRL_G |
| @@ -3181,15 +3188,15 @@ ns_read_socket (struct terminal *terminal, int expected, | |||
| 3181 | to ourself, otherwise [NXApp run] will never exit. */ | 3188 | to ourself, otherwise [NXApp run] will never exit. */ |
| 3182 | send_appdefined = YES; | 3189 | send_appdefined = YES; |
| 3183 | 3190 | ||
| 3184 | /* TODO: from termhooks.h: */ | 3191 | /* If called via ns_select, this is called once with expected=1, |
| 3185 | /* XXX Please note that a non-zero value of EXPECTED only means that | 3192 | because we expect either the timeout or file descriptor activity. |
| 3186 | there is available input on at least one of the currently opened | 3193 | In this case the first event through will either be real input or |
| 3187 | terminal devices -- but not necessarily on this device. | 3194 | one of these. read_avail_input() then calls once more with expected=0 |
| 3188 | Therefore, in most cases EXPECTED should be simply ignored. */ | 3195 | and in that case we need to return quickly if there is nothing. |
| 3189 | /* However, if in ns_select, this is called from gobble_input, which | 3196 | If we're being called outside of that, it's also OK to return quickly |
| 3190 | appears to set it correctly for our purposes, and always assuming | 3197 | after one iteration through the event loop, since other terms do |
| 3191 | !expected causes 100% CPU usage. */ | 3198 | this and emacs expects it. */ |
| 3192 | if (!inNsSelect || !expected) | 3199 | if (!(inNsSelect && expected)) // (!inNsSelect || !expected) |
| 3193 | { | 3200 | { |
| 3194 | /* Post an application defined event on the event queue. When this is | 3201 | /* Post an application defined event on the event queue. When this is |
| 3195 | received the [NXApp run] will return, thus having processed all | 3202 | received the [NXApp run] will return, thus having processed all |
| @@ -3208,6 +3215,7 @@ ns_read_socket (struct terminal *terminal, int expected, | |||
| 3208 | --handling_signal; | 3215 | --handling_signal; |
| 3209 | #endif | 3216 | #endif |
| 3210 | UNBLOCK_INPUT; | 3217 | UNBLOCK_INPUT; |
| 3218 | |||
| 3211 | return nevents; | 3219 | return nevents; |
| 3212 | } | 3220 | } |
| 3213 | 3221 | ||
| @@ -3267,9 +3275,13 @@ ns_select (int nfds, fd_set *readfds, fd_set *writefds, | |||
| 3267 | retain]; | 3275 | retain]; |
| 3268 | 3276 | ||
| 3269 | /* Let Application dispatch events until it receives an event of the type | 3277 | /* Let Application dispatch events until it receives an event of the type |
| 3270 | NX_APPDEFINED, which should only be sent by timeout_handler. */ | 3278 | NX_APPDEFINED, which should only be sent by timeout_handler. |
| 3279 | We tell read_avail_input() that input is "expected" because we do expect | ||
| 3280 | either the timeout or fd handler to fire, and if they don't, the original | ||
| 3281 | call from process.c that got us here expects us to wait until some input | ||
| 3282 | comes. */ | ||
| 3271 | inNsSelect = 1; | 3283 | inNsSelect = 1; |
| 3272 | gobble_input (timeout ? 1 : 0); | 3284 | gobble_input (1); |
| 3273 | ev = last_appdefined_event; | 3285 | ev = last_appdefined_event; |
| 3274 | inNsSelect = 0; | 3286 | inNsSelect = 0; |
| 3275 | 3287 | ||