summaryrefslogtreecommitdiff
path: root/lisp/emacs-lisp/byte-run.el
diff options
context:
space:
mode:
authorJan Djärv <jan.h.d@swipnet.se>2012-08-15 20:58:19 +0200
committerJan Djärv <jan.h.d@swipnet.se>2012-08-15 20:58:19 +0200
commitddee65158cd55a0c045a1ebc26f8ff73768cdc64 (patch)
tree3ec8cde41573810900d76832751badde8c57f41e /lisp/emacs-lisp/byte-run.el
parentac4845a68bf3ee0a0b4b88c292207d9738b981bd (diff)
downloademacs-ddee65158cd55a0c045a1ebc26f8ff73768cdc64.tar.gz
emacs-ddee65158cd55a0c045a1ebc26f8ff73768cdc64.tar.bz2
emacs-ddee65158cd55a0c045a1ebc26f8ff73768cdc64.zip
Improve event loop on NS so that no polling is used.
* nsmenu.m (popupSession): Remove. (pop_down_menu): Remove endModalSession. (timeout_handler:): New method. (runDialogAt:): Get next timeout. Start a NSTimer with that timeout. Call runModalForWindow. Check timer_fired when it returns. If not set, cancel timer and break out of loop. Otherwise loop again, with a new timeout. * nsterm.h (EmacsApp): fd_handler takes id argument. (EmacsDialogPanel): Add timer_fired and timeout_handler. * nsterm.m: Include fcntl.h if present. (fd_entry, t_readfds, inNsSelect): Remove. (select_writefds, select_valid, select_timeout, selfds) (select_mutex, apploopnr): Add. (EV_TRAILER): Call kbd_buffer_store_event_hold only if q_event_ptr. Otherwise call kbd_buffer_store_event. (ns_send_appdefined): Remove release of fd_entry. (ns_read_socket): Always send appdefined. Remove inNsSelect check. Increment and decrement apploopnr. (ns_select): If no file descriptors, just do a NSTimer. Otherwise copy read/write masks and start select thread (fd_handler). Start main loop and wait for application defined event. Inform select thread to stop selecting after main loop is exited. (ns_term_init): Create selfds pipe and set non-blocking. Initialize select_mutex. Start the select thread (fd_handler). (fd_handler:): Loop forever, wait for info from the main thread to either start or stop selecting. When select returns, send and appdefined event. (sendScrollEventAtLoc:fromEvent:): Check if q_event_ptr is set. If not call kbd_buffer_store_event.
Diffstat (limited to 'lisp/emacs-lisp/byte-run.el')
0 files changed, 0 insertions, 0 deletions