]> Dogcows Code - chaz/openbox/commitdiff
better handling of starting a new interactive grab while one is in progress
authorDana Jansens <danakj@orodu.net>
Wed, 20 Aug 2003 23:25:59 +0000 (23:25 +0000)
committerDana Jansens <danakj@orodu.net>
Wed, 20 Aug 2003 23:25:59 +0000 (23:25 +0000)
openbox/keyboard.c

index bcac0a3c3220ae0d38b8403cf9358371f087d2b3..5bda7a7bfddee85807effcba085ddbd20d21819e 100644 (file)
@@ -112,14 +112,20 @@ gboolean keyboard_bind(GList *keylist, ObAction *action)
 void keyboard_interactive_grab(guint state, ObClient *client,
                                ObFrameContext context, ObAction *action)
 {
-    if (!interactive_grab && grab_keyboard(TRUE)) {
+    if (!interactive_grab) {
+        if (!grab_keyboard(TRUE))
+            return;
+        if (!grab_pointer(TRUE, None)) {
+            grab_keyboard(FALSE);
+            return;
+        }
         interactive_grab = TRUE;
-        grabbed_state = state;
-        grabbed_client = client;
-        grabbed_action = action;
-        grabbed_context = context;
-        grab_pointer(TRUE, None);
     }
+
+    grabbed_state = state;
+    grabbed_client = client;
+    grabbed_action = action;
+    grabbed_context = context;
 }
 
 gboolean keyboard_process_interactive_grab(const XEvent *e,
This page took 0.024856 seconds and 4 git commands to generate.