diff options
author | Ken Brown <kbrown@cornell.edu> | 2012-05-19 17:46:43 -0400 |
---|---|---|
committer | Ken Brown <kbrown@cornell.edu> | 2012-05-19 17:46:43 -0400 |
commit | b2f4d39feba297c55c0547d933c018267d9157f8 (patch) | |
tree | 88ecefeb1949d396610db3c36b0d5e0a0fbd1631 | |
parent | 567739fbcb3d46656f7fc4397e89f17334d52cdc (diff) | |
download | emacs-b2f4d39feba297c55c0547d933c018267d9157f8.tar.gz |
Improve test for when xg_select should just invoke select (bug#9754).
* src/xfns.c (x_in_use): Remove `static' qualifier.
* src/xterm.h (x_in_use): Declare.
* src/xgselect.c: Include xterm.h.
(xg_select): Test `x_in_use' instead of `inhibit_window_system'
and `display_arg'.
-rw-r--r-- | src/ChangeLog | 8 | ||||
-rw-r--r-- | src/xfns.c | 2 | ||||
-rw-r--r-- | src/xgselect.c | 3 | ||||
-rw-r--r-- | src/xterm.h | 1 |
4 files changed, 12 insertions, 2 deletions
diff --git a/src/ChangeLog b/src/ChangeLog index 0f1914b6e46..de07e87e7b5 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -1,3 +1,11 @@ +2012-05-19 Ken Brown <kbrown@cornell.edu> + + * xfns.c (x_in_use): Remove `static' qualifier. + * xterm.h (x_in_use): Declare. + * xgselect.c: Include xterm.h. + (xg_select): Test `x_in_use' instead of `inhibit_window_system' + and `display_arg' (bug#9754). + 2012-05-19 Paul Eggert <eggert@cs.ucla.edu> * s/ms-w32.h (HAVE_GETDOMAINNAME): Remove; not needed. diff --git a/src/xfns.c b/src/xfns.c index 510a66d6349..717378f1cd1 100644 --- a/src/xfns.c +++ b/src/xfns.c @@ -136,7 +136,7 @@ char *gray_bitmap_bits = gray_bits; /* Nonzero if using X. */ -static int x_in_use; +int x_in_use; static Lisp_Object Qnone; static Lisp_Object Qsuppress_icon; diff --git a/src/xgselect.c b/src/xgselect.c index 8b5ee68e55b..69ad93b3127 100644 --- a/src/xgselect.c +++ b/src/xgselect.c @@ -27,6 +27,7 @@ along with GNU Emacs. If not, see <http§://www.gnu.org/licenses/>. */ #include <glib.h> #include <errno.h> #include <setjmp.h> +#include "xterm.h" static GPollFD *gfds; static ptrdiff_t gfds_size; @@ -43,7 +44,7 @@ xg_select (int max_fds, SELECT_TYPE *rfds, SELECT_TYPE *wfds, SELECT_TYPE *efds, int n_gfds = 0, our_tmo = 0, retval = 0, our_fds = 0; int i, nfds, fds_lim, tmo_in_millisec; - if (inhibit_window_system || !display_arg) + if (!x_in_use) return select (max_fds, rfds, wfds, efds, timeout); if (rfds) memcpy (&all_rfds, rfds, sizeof (all_rfds)); diff --git a/src/xterm.h b/src/xterm.h index 86daa7bd27e..89eb493a43c 100644 --- a/src/xterm.h +++ b/src/xterm.h @@ -1038,6 +1038,7 @@ extern void x_clipboard_manager_save_all (void); extern struct x_display_info * check_x_display_info (Lisp_Object); extern Lisp_Object x_get_focus_frame (struct frame *); +extern int x_in_use; #ifdef USE_GTK extern int xg_set_icon (struct frame *, Lisp_Object); |