From: Jan Djärv Date: Sat, 8 Jun 2013 08:48:52 +0000 (+0200) Subject: * xgselect.c (xg_select): Remove call to window_system_available X-Git-Tag: emacs-24.3.90~173^2^2~42^2~45^2~387^2~2026^2~36 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=5de0e0116411d36673ee3eeeb1d207f25c0d4b95;p=emacs.git * xgselect.c (xg_select): Remove call to window_system_available and g_main_context_pending at the top, so Gdk events (i.e. file notify) are processed when Emacs is started with -nw. --- diff --git a/src/ChangeLog b/src/ChangeLog index 646f1d43f43..7d650885f19 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,9 @@ +2013-06-08 Jan Djärv + + * xgselect.c (xg_select): Remove call to window_system_available + and g_main_context_pending at the top, so Gdk events (i.e. file + notify) are processed when Emacs is started with -nw. + 2013-06-07 Eli Zaretskii * Makefile.in (ctagsfiles1, ctagsfiles2): Don't include *.m files. diff --git a/src/xgselect.c b/src/xgselect.c index 38b9705e976..e2d14f12e9f 100644 --- a/src/xgselect.c +++ b/src/xgselect.c @@ -44,9 +44,13 @@ xg_select (int fds_lim, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, int i, nfds, tmo_in_millisec; USE_SAFE_ALLOCA; - if (! (window_system_available (NULL) - && g_main_context_pending (context = g_main_context_default ()))) - return pselect (fds_lim, rfds, wfds, efds, timeout, sigmask); + /* Do not try to optimize with an initial check with g_main_context_pending + and a call to pselect if it returns false. If Gdk has a timeout for 0.01 + second, and Emacs has a timeout for 1 second, g_main_context_pending will + return false, but the timeout will be 1 second, thus missing the gdk + timeout with a lot. */ + + context = g_main_context_default (); if (rfds) all_rfds = *rfds; else FD_ZERO (&all_rfds);