summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChong Yidong <cyd@stupidchicken.com>2010-01-16 15:20:32 -0500
committerChong Yidong <cyd@stupidchicken.com>2010-01-16 15:20:32 -0500
commit617364feb7163852e7c86323983d58d645063760 (patch)
tree0d2a80bbf76b57442f905b6cee52dc45444196b3
parent82b52e0dfdb69d993f39237fc14345e10356a32b (diff)
downloademacs-617364feb7163852e7c86323983d58d645063760.tar.gz
* xterm.c (event_handler_gdk): Block input (Bug#5037).
-rw-r--r--src/ChangeLog4
-rw-r--r--src/xterm.c21
2 files changed, 17 insertions, 8 deletions
diff --git a/src/ChangeLog b/src/ChangeLog
index c18cd27fa0a..e1d2ba440ab 100644
--- a/src/ChangeLog
+++ b/src/ChangeLog
@@ -1,3 +1,7 @@
+2010-01-16 Stefan Monnier <monnier@iro.umontreal.ca>
+
+ * xterm.c (event_handler_gdk): Block input (Bug#5037).
+
2010-01-16 Chong Yidong <cyd@stupidchicken.com>
* emacs.c (standard_args): Adjust arg priorities to reflect how
diff --git a/src/xterm.c b/src/xterm.c
index b541683e5ad..1add3c415e7 100644
--- a/src/xterm.c
+++ b/src/xterm.c
@@ -5797,6 +5797,7 @@ event_handler_gdk (gxev, ev, data)
{
XEvent *xev = (XEvent *) gxev;
+ BLOCK_INPUT;
if (current_count >= 0)
{
struct x_display_info *dpyinfo;
@@ -5807,23 +5808,27 @@ event_handler_gdk (gxev, ev, data)
/* Filter events for the current X input method.
GTK calls XFilterEvent but not for key press and release,
so we do it here. */
- if (xev->type == KeyPress || xev->type == KeyRelease)
- if (dpyinfo && x_filter_event (dpyinfo, xev))
- return GDK_FILTER_REMOVE;
+ if ((xev->type == KeyPress || xev->type == KeyRelease)
+ && dpyinfo
+ && x_filter_event (dpyinfo, xev))
+ {
+ UNBLOCK_INPUT;
+ return GDK_FILTER_REMOVE;
+ }
#endif
if (! dpyinfo)
current_finish = X_EVENT_NORMAL;
else
- {
- current_count +=
- handle_one_xevent (dpyinfo, xev, &current_finish,
- current_hold_quit);
- }
+ current_count +=
+ handle_one_xevent (dpyinfo, xev, &current_finish,
+ current_hold_quit);
}
else
current_finish = x_dispatch_event (xev, xev->xany.display);
+ UNBLOCK_INPUT;
+
if (current_finish == X_EVENT_GOTO_OUT || current_finish == X_EVENT_DROP)
return GDK_FILTER_REMOVE;