]> git.eshelyaron.com Git - emacs.git/commitdiff
* xterm.c (event_handler_gdk): Block input (Bug#5037).
authorChong Yidong <cyd@stupidchicken.com>
Sat, 16 Jan 2010 20:20:32 +0000 (15:20 -0500)
committerChong Yidong <cyd@stupidchicken.com>
Sat, 16 Jan 2010 20:20:32 +0000 (15:20 -0500)
src/ChangeLog
src/xterm.c

index c18cd27fa0a35ab790ab9c0f33b94b5ff41b0ee3..e1d2ba440ab747f6e1d7fcf7589842031247c60f 100644 (file)
@@ -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
index b541683e5ad088ad6270157747a3a957fe293708..1add3c415e7dbe197407d2519f8244143fc007de 100644 (file)
@@ -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;