]> Dogcows Code - chaz/openbox/commitdiff
gracefully handle grabs failing when doing interactive actions
authorDana Jansens <danakj@orodu.net>
Sat, 11 Oct 2003 16:19:17 +0000 (16:19 +0000)
committerDana Jansens <danakj@orodu.net>
Sat, 11 Oct 2003 16:19:17 +0000 (16:19 +0000)
openbox/action.c
openbox/keyboard.c
openbox/keyboard.h

index 35a649b0c50982e57e2cd8eaaf827f5d4b865d17..5f8b306fb1591b8448de8190795bb04e8949eb18 100644 (file)
@@ -946,7 +946,8 @@ void action_run_list(GSList *acts, ObClient *c, ObFrameContext context,
                 a->data.inter.cancel = cancel;
                 a->data.inter.final = done;
                 if (!(cancel || done))
-                    keyboard_interactive_grab(state, a->data.any.c, a);
+                    if (!keyboard_interactive_grab(state, a->data.any.c, a))
+                        continue;
 
                 /* interactive actions are not queued */
                 a->func(&a->data);
index 11b3a98509a058fa6964384342f123f117b13fbc..05d40cd06b1801c8501c4e1a0818a0d1d4b5d90b 100644 (file)
@@ -155,8 +155,8 @@ gboolean keyboard_bind(GList *keylist, ObAction *action)
     return TRUE;
 }
 
-void keyboard_interactive_grab(guint state, ObClient *client,
-                               ObAction *action)
+gboolean keyboard_interactive_grab(guint state, ObClient *client,
+                                   ObAction *action)
 {
     ObInteractiveState *s;
 
@@ -164,10 +164,10 @@ void keyboard_interactive_grab(guint state, ObClient *client,
 
     if (!interactive_states) {
         if (!grab_keyboard(TRUE))
-            return;
+            return FALSE;
         if (!grab_pointer(TRUE, OB_CURSOR_NONE)) {
             grab_keyboard(FALSE);
-            return;
+            return FALSE;
         }
     }
 
@@ -178,6 +178,8 @@ void keyboard_interactive_grab(guint state, ObClient *client,
     s->actions = g_slist_append(NULL, action);
 
     interactive_states = g_slist_append(interactive_states, s);
+
+    return TRUE;
 }
 
 void keyboard_interactive_end(ObInteractiveState *s,
index be181bd75c590556195ec07d96d1409a3e8570e8..8a9eb47f965202b65eb0fd95116b3f98a660e0e4 100644 (file)
@@ -39,8 +39,8 @@ void keyboard_unbind_all();
 void keyboard_event(struct _ObClient *client, const XEvent *e);
 void keyboard_reset_chains();
 
-void keyboard_interactive_grab(guint state, struct _ObClient *client,
-                               struct _ObAction *action);
+gboolean keyboard_interactive_grab(guint state, struct _ObClient *client,
+                                   struct _ObAction *action);
 gboolean keyboard_process_interactive_grab(const XEvent *e,
                                            struct _ObClient **client);
 
This page took 0.027473 seconds and 4 git commands to generate.