]> Dogcows Code - chaz/openbox/blobdiff - plugins/keyboard/keyboard.c
set the last time to CurrentTime for events that don't have time stamps
[chaz/openbox] / plugins / keyboard / keyboard.c
index cf48b2e9290bf53edb062ec3d599c18c966b7eac..7e2df47536109d826f068ccc15ddfdf16aadf86a 100644 (file)
@@ -1,11 +1,13 @@
 #include "../../kernel/focus.h"
 #include "../../kernel/dispatch.h"
 #include "../../kernel/openbox.h"
+#include "../../kernel/event.h"
 #include "../../kernel/grab.h"
 #include "../../kernel/action.h"
 #include "tree.h"
 #include "keyboard.h"
 #include "keysrc.h"
+#include "translate.h"
 #include <glib.h>
 
 void plugin_setup_config()
@@ -38,7 +40,8 @@ static void reset_chains()
     if (grabbed) {
        grabbed = FALSE;
         grab_keyboard(FALSE);
-    }
+    } else
+        XAllowEvents(ob_display, AsyncKeyboard, event_lasttime);
 }
 
 gboolean kbind(GList *keylist, Action *action)
@@ -100,6 +103,8 @@ static void press(ObEvent *e, void *foo)
                     if (!grabbed) {
                         grab_keyboard(TRUE);
                         grabbed = TRUE;
+                        XAllowEvents(ob_display, AsyncKeyboard,
+                                     event_lasttime);
                     }
                     curpos = p;
                 } else {
@@ -119,7 +124,6 @@ static void press(ObEvent *e, void *foo)
             p = p->next_sibling;
         }
     }
-    XAllowEvents(ob_display, AsyncKeyboard, e->data.x.e->xkey.time);
 }
 
 void plugin_startup()
This page took 0.022637 seconds and 4 git commands to generate.