aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMichael Albinus2014-02-04 12:40:31 +0100
committerMichael Albinus2014-02-04 12:40:31 +0100
commit86d2bf49962c66f19e467804dfcfb5153b460f51 (patch)
tree94f74f1c5128ccb9e41d2f23ab292d5a4aff007e
parent764ec9e5f0adaff96b52252eea71eb30ef7cefa1 (diff)
downloademacs-86d2bf49962c66f19e467804dfcfb5153b460f51.tar.gz
emacs-86d2bf49962c66f19e467804dfcfb5153b460f51.zip
* keyboard.c (kbd_buffer_get_event): Read file notification events
also in batch mode. * xgselect.c (xg_select): Read glib events in any case, even if there are no file descriptors to watch for. (Bug#16519)
-rw-r--r--src/ChangeLog8
-rw-r--r--src/keyboard.c4
-rw-r--r--src/xgselect.c24
3 files changed, 20 insertions, 16 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index ec003cd59b2..746bdffad22 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,11 @@
12014-02-04 Michael Albinus <michael.albinus@gmx.de>
2
3 * keyboard.c (kbd_buffer_get_event): Read file notification events
4 also in batch mode.
5
6 * xgselect.c (xg_select): Read glib events in any case, even if
7 there are no file descriptors to watch for. (Bug#16519)
8
12014-02-03 Martin Rudalics <rudalics@gmx.at> 92014-02-03 Martin Rudalics <rudalics@gmx.at>
2 10
3 * dispextern.h (face_id): Add WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID 11 * dispextern.h (face_id): Add WINDOW_DIVIDER_FIRST_PIXEL_FACE_ID
diff --git a/src/keyboard.c b/src/keyboard.c
index 5430e7971b4..c1de4dafcdd 100644
--- a/src/keyboard.c
+++ b/src/keyboard.c
@@ -3820,7 +3820,7 @@ kbd_buffer_get_event (KBOARD **kbp,
3820 } 3820 }
3821#endif /* subprocesses */ 3821#endif /* subprocesses */
3822 3822
3823#ifndef HAVE_DBUS /* We want to read D-Bus events in batch mode. */ 3823#if !defined HAVE_DBUS && !defined USE_FILE_NOTIFY
3824 if (noninteractive 3824 if (noninteractive
3825 /* In case we are running as a daemon, only do this before 3825 /* In case we are running as a daemon, only do this before
3826 detaching from the terminal. */ 3826 detaching from the terminal. */
@@ -3831,7 +3831,7 @@ kbd_buffer_get_event (KBOARD **kbp,
3831 *kbp = current_kboard; 3831 *kbp = current_kboard;
3832 return obj; 3832 return obj;
3833 } 3833 }
3834#endif /* ! HAVE_DBUS */ 3834#endif /* !defined HAVE_DBUS && !defined USE_FILE_NOTIFY */
3835 3835
3836 /* Wait until there is input available. */ 3836 /* Wait until there is input available. */
3837 for (;;) 3837 for (;;)
diff --git a/src/xgselect.c b/src/xgselect.c
index 699965cfda1..a281414610a 100644
--- a/src/xgselect.c
+++ b/src/xgselect.c
@@ -124,23 +124,19 @@ xg_select (int fds_lim, fd_set *rfds, fd_set *wfds, fd_set *efds,
124 } 124 }
125 } 125 }
126 126
127 if (our_fds > 0 || (nfds == 0 && tmop == &tmo)) 127 /* If Gtk+ is in use eventually gtk_main_iteration will be called,
128 { 128 unless retval is zero. */
129
130 /* If Gtk+ is in use eventually gtk_main_iteration will be called,
131 unless retval is zero. */
132#ifdef USE_GTK 129#ifdef USE_GTK
133 if (retval == 0) 130 if (retval == 0)
134#endif 131#endif
135 while (g_main_context_pending (context)) 132 while (g_main_context_pending (context))
136 g_main_context_dispatch (context); 133 g_main_context_dispatch (context);
137 134
138 /* To not have to recalculate timeout, return like this. */ 135 /* To not have to recalculate timeout, return like this. */
139 if (retval == 0) 136 if ((our_fds > 0 || (nfds == 0 && tmop == &tmo)) && (retval == 0))
140 { 137 {
141 retval = -1; 138 retval = -1;
142 errno = EINTR; 139 errno = EINTR;
143 }
144 } 140 }
145 141
146 return retval; 142 return retval;