]> Dogcows Code - chaz/openbox/blobdiff - openbox/keyboard.c
fix whitespace
[chaz/openbox] / openbox / keyboard.c
index 513b6e1e30785dd2a63f7d9a2ea531ad66fe81d2..bcac0a3c3220ae0d38b8403cf9358371f087d2b3 100644 (file)
@@ -8,6 +8,7 @@
 #include "action.h"
 #include "prop.h"
 #include "timer.h"
+#include "config.h"
 #include "keytree.h"
 #include "keyboard.h"
 #include "translate.h"
@@ -36,6 +37,10 @@ static void grab_for_window(Window win, gboolean grab)
             grab_key(p->key, p->state, win, GrabModeAsync);
             p = p->next_sibling;
         }
+        if (curpos)
+            grab_key(config_keyboard_reset_keycode,
+                     config_keyboard_reset_state,
+                     win, GrabModeAsync);
     }
 }
 
@@ -179,6 +184,13 @@ void keyboard_event(ObClient *client, const XEvent *e)
 
     g_assert(e->type == KeyPress);
 
+    if (e->xkey.keycode == config_keyboard_reset_keycode &&
+        e->xkey.state == config_keyboard_reset_state)
+    {
+        keyboard_reset_chains();
+        return;
+    }
+
     if (curpos == NULL)
         p = keyboard_firstnode;
     else
@@ -232,10 +244,8 @@ void keyboard_event(ObClient *client, const XEvent *e)
 
                         if (act->func == action_showmenu)
                         {
-                            act->data.showmenu.x =
-                                e->xkey.x_root;
-                            act->data.showmenu.y =
-                                e->xkey.y_root;
+                            act->data.showmenu.x = e->xkey.x_root;
+                            act->data.showmenu.y = e->xkey.y_root;
                         }
 
                         act->data.any.c = client;
This page took 0.025585 seconds and 4 git commands to generate.