]> Dogcows Code - chaz/openbox/commitdiff
provide a way to remove all bindings
authorDana Jansens <danakj@orodu.net>
Wed, 17 Sep 2003 08:11:59 +0000 (08:11 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 17 Sep 2003 08:11:59 +0000 (08:11 +0000)
openbox/keyboard.c
openbox/keyboard.h
openbox/mouse.c
openbox/mouse.h

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();
 }
 
index 95181065c9ef5a34d0b478f28cdcb0cc519adc9f..be181bd75c590556195ec07d96d1409a3e8570e8 100644 (file)
@@ -34,6 +34,7 @@ void keyboard_startup(gboolean reconfig);
 void keyboard_shutdown(gboolean reconfig);
 
 gboolean keyboard_bind(GList *keylist, ObAction *action);
+void keyboard_unbind_all();
 
 void keyboard_event(struct _ObClient *client, const XEvent *e);
 void keyboard_reset_chains();
index 251251b77150582c8067ee7c0e2a4e9566a69d2e..703ea36ba32f822c2b91ac6fd8b53cfe52c89b1e 100644 (file)
@@ -128,7 +128,7 @@ static void grab_all_clients(gboolean grab)
        mouse_grab_for_client(it->data, grab);
 }
 
-static void clearall()
+void mouse_unbind_all()
 {
     int i;
     GSList *it;
@@ -295,8 +295,8 @@ void mouse_event(ObClient *client, XEvent *e)
     }
 }
 
-gboolean mouse_bind(char *buttonstr, char *contextstr, ObMouseAction mact,
-                    ObAction *action)
+gboolean mouse_bind(const gchar *buttonstr, const gchar *contextstr,
+                    ObMouseAction mact, ObAction *action)
 {
     guint state, button;
     ObFrameContext context;
@@ -347,5 +347,5 @@ void mouse_startup(gboolean reconfig)
 void mouse_shutdown(gboolean reconfig)
 {
     grab_all_clients(FALSE);
-    clearall();
+    mouse_unbind_all();
 }
index f4504347a3158f1647da19a1600253cde8e93834..a570a16a446a74b2a1bb6521f3c1bd85145371a3 100644 (file)
@@ -28,8 +28,9 @@
 void mouse_startup(gboolean reconfig);
 void mouse_shutdown(gboolean reconfig);
 
-gboolean mouse_bind(char *buttonstr, char *contextstr, ObMouseAction mact,
-                    ObAction *action);
+gboolean mouse_bind(const gchar *buttonstr, const gchar *contextstr,
+                    ObMouseAction mact, ObAction *action);
+void mouse_unbind_all();
 
 void mouse_event(struct _ObClient *client, XEvent *e);
 
This page took 0.028221 seconds and 4 git commands to generate.