]> Dogcows Code - chaz/openbox/blobdiff - plugins/keyboard/keyboard.c
use CurrentTime again?
[chaz/openbox] / plugins / keyboard / keyboard.c
index 2b3f3e5a804515bfab901308023849dea12817f7..22ea5556bcb4b2580a2dd739ab32f54b6e667c61 100644 (file)
@@ -6,6 +6,7 @@
 #include "tree.h"
 #include "keyboard.h"
 #include "keysrc.h"
+#include "translate.h"
 #include <glib.h>
 
 void plugin_setup_config()
@@ -38,7 +39,8 @@ static void reset_chains()
     if (grabbed) {
        grabbed = FALSE;
         grab_keyboard(FALSE);
-    }
+    } else
+        XAllowEvents(ob_display, AsyncKeyboard, CurrentTime);
 }
 
 gboolean kbind(GList *keylist, Action *action)
@@ -49,10 +51,8 @@ gboolean kbind(GList *keylist, Action *action)
     g_assert(keylist != NULL);
     g_assert(action != NULL);
 
-    if (!(tree = tree_build(keylist))) {
-        g_warning("invalid binding");
+    if (!(tree = tree_build(keylist)))
         return FALSE;
-    }
     if ((t = tree_find(tree, &conflict)) != NULL) {
        /* already bound to something */
        g_warning("keychain is already bound");
@@ -102,6 +102,7 @@ static void press(ObEvent *e, void *foo)
                     if (!grabbed) {
                         grab_keyboard(TRUE);
                         grabbed = TRUE;
+                        XAllowEvents(ob_display, AsyncKeyboard, CurrentTime);
                     }
                     curpos = p;
                 } else {
@@ -121,13 +122,14 @@ static void press(ObEvent *e, void *foo)
             p = p->next_sibling;
         }
     }
-    XAllowEvents(ob_display, AsyncKeyboard, e->data.x.e->xkey.time);
 }
 
 void plugin_startup()
 {
     dispatch_register(Event_X_KeyPress, (EventHandler)press, NULL);
 
+    translate_key("C-g", &reset_state, &reset_key);
+
     keysrc_parse();
 }
 
This page took 0.02226 seconds and 4 git commands to generate.