]> Dogcows Code - chaz/openbox/blobdiff - openbox/keyboard.c
provide a way to remove all bindings
[chaz/openbox] / openbox / keyboard.c
index 8786cd2c05b82a2d9131ed44f1605f4226cd5046..54de380c4a38a8fc6d05a381df6ec8370d0230b9 100644 (file)
@@ -98,6 +98,14 @@ void keyboard_reset_chains()
     }
 }
 
+void keyboard_unbind_all()
+{
+    tree_destroy(keyboard_firstnode);
+    keyboard_firstnode = NULL;
+    grab_keys(FALSE);
+    curpos = NULL;
+}
+
 gboolean keyboard_bind(GList *keylist, ObAction *action)
 {
     KeyBindingTree *tree, *t;
@@ -297,16 +305,13 @@ void keyboard_shutdown(gboolean reconfig)
     if (!reconfig)
         client_remove_destructor(keyboard_interactive_end_client);
 
-    tree_destroy(keyboard_firstnode);
-    keyboard_firstnode = NULL;
-
     for (it = interactive_states; it; it = g_slist_next(it))
         g_free(it->data);
     g_slist_free(interactive_states);
     interactive_states = NULL;
 
     ob_main_loop_timeout_remove(ob_main_loop, chain_timeout);
-    grab_keys(FALSE);
-    curpos = NULL;
+
+    keyboard_unbind_all();
 }
 
This page took 0.024778 seconds and 4 git commands to generate.