From: Jan Djärv Date: Sat, 17 Nov 2012 15:28:56 +0000 (+0100) Subject: * nsterm.m (hold_event): Set send_appdefined to YES. X-Git-Tag: emacs-24.2.90~51 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=7436fc63c0c24eb7fee800176c387db87f51de50;p=emacs.git * nsterm.m (hold_event): Set send_appdefined to YES. (ns_select): Return at once if events are held (Bug#12834). --- diff --git a/src/ChangeLog b/src/ChangeLog index 64adec7491a..d88e43b2b7f 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,8 @@ +2012-11-17 Jan Djärv + + * nsterm.m (hold_event): Set send_appdefined to YES (Bug#12834). + (ns_select): Return at once if events are held (Bug#12834). + 2012-11-16 enami tsugutomo * unexelf.c (ELFSIZE) [__NetBSD__ && _LP64]: Set to 64. diff --git a/src/nsterm.m b/src/nsterm.m index f4982e0a7cb..9d52bd7f52b 100644 --- a/src/nsterm.m +++ b/src/nsterm.m @@ -314,6 +314,7 @@ hold_event (struct input_event *event) hold_event_q.q[hold_event_q.nr++] = *event; /* Make sure ns_read_socket is called, i.e. we have input. */ kill (0, SIGIO); + send_appdefined = YES; } static Lisp_Object @@ -3445,6 +3446,14 @@ ns_select (int nfds, fd_set *readfds, fd_set *writefds, /* NSTRACE (ns_select); */ + if (hold_event_q.nr > 0) + { + /* We already have events pending. */ + kill (0, SIGIO); + errno = EINTR; + return -1; + } + for (k = 0; k < nfds+1; k++) { if (readfds && FD_ISSET(k, readfds)) ++nr;