[Xfce4-commits] <xfwm4:master> Fix some events being lost causing the tabwin window to remain sometimes after the key has been released

Olivier Fourdan noreply at xfce.org
Fri Oct 28 16:14:01 CEST 2011


Updating branch refs/heads/master
         to 18d09c75542b14a0dcc28b523aceda0225c298fc (commit)
       from 94a88821d7dc8bfe9362b8d27ed7749b26d3ef76 (commit)

commit 18d09c75542b14a0dcc28b523aceda0225c298fc
Author: Olivier Fourdan <fourdan at xfce.org>
Date:   Fri Oct 28 15:51:18 2011 +0200

    Fix some events being lost causing the tabwin window to remain sometimes after the key has been released

 src/events.c |   12 ++++++++----
 src/main.c   |    2 ++
 2 files changed, 10 insertions(+), 4 deletions(-)

diff --git a/src/events.c b/src/events.c
index eee501a..31f4219 100644
--- a/src/events.c
+++ b/src/events.c
@@ -300,8 +300,6 @@ handleKeyPress (DisplayInfo *display_info, XKeyEvent * ev)
 
     TRACE ("entering handleKeyEvent");
 
-    XAllowEvents (display_info->dpy, AsyncKeyboard, ev->time);
-
     ev_screen_info = myDisplayGetScreenFromRoot (display_info, ev->root);
     if (!ev_screen_info)
     {
@@ -528,6 +526,9 @@ handleKeyPress (DisplayInfo *display_info, XKeyEvent * ev)
             break;
     }
 
+    /* Release pending events */
+    XAllowEvents (display_info->dpy, SyncKeyboard, CurrentTime);
+
     return status;
 }
 
@@ -536,6 +537,9 @@ handleKeyRelease (DisplayInfo *display_info, XKeyEvent * ev)
 {
     TRACE ("entering handleKeyRelease");
 
+    /* Release pending events */
+    XAllowEvents (display_info->dpy, SyncKeyboard, CurrentTime);
+
     return EVENT_FILTER_PASS;
 }
 
@@ -1040,7 +1044,7 @@ handleButtonPress (DisplayInfo *display_info, XButtonEvent * ev)
     }
 
     /* Release pending events */
-    XAllowEvents (display_info->dpy, replay ? ReplayPointer : SyncPointer, myDisplayGetCurrentTime (display_info));
+    XAllowEvents (display_info->dpy, replay ? ReplayPointer : SyncPointer, CurrentTime);
 
     return EVENT_FILTER_REMOVE;
 }
@@ -1060,7 +1064,7 @@ handleButtonRelease (DisplayInfo *display_info, XButtonEvent * ev)
     }
 
     /* Release pending events */
-    XAllowEvents (display_info->dpy, SyncPointer, myDisplayGetCurrentTime (display_info));
+    XAllowEvents (display_info->dpy, SyncPointer, CurrentTime);
 
     return EVENT_FILTER_REMOVE;
 }
diff --git a/src/main.c b/src/main.c
index 5a0bfb1..40c0bca 100644
--- a/src/main.c
+++ b/src/main.c
@@ -70,6 +70,8 @@
     SubstructureRedirectMask|\
     ButtonPressMask|\
     ButtonReleaseMask|\
+    KeyPressMask|\
+    KeyReleaseMask|\
     FocusChangeMask|\
     PropertyChangeMask|\
     ColormapNotify


More information about the Xfce4-commits mailing list