]> Dogcows Code - chaz/openbox/blobdiff - openbox/action.c
no more interactive mouse actions, they are evil etc. actions now "feel" much more...
[chaz/openbox] / openbox / action.c
index e0f411e0fa2a1b47ca1dc211c072f69a20224acc..efc7f1ef513b89dba2bac42d9fb692e2ef2e3556 100644 (file)
@@ -698,6 +698,9 @@ ObAction *action_from_string(char *name, ObUserAction uact)
             a = action_new(actionstrings[i].func, uact);
             if (actionstrings[i].setup)
                 actionstrings[i].setup(&a, uact);
+            /* only key bindings can be interactive. thus saith the xor. */
+            if (uact != OB_USER_ACTION_KEYBOARD_KEY)
+                a->data.any.interactive = FALSE;
             break;
         }
     if (!exist)
@@ -764,7 +767,6 @@ ObAction *action_parse(ObParseInst *i, xmlDocPtr doc, xmlNodePtr node,
 }
 
 void action_run_full(ObAction *a, struct _ObClient *c,
-                     ObFrameContext context,
                      guint state, guint button, gint x, gint y,
                      gboolean cancel, gboolean done)
 {
@@ -781,7 +783,7 @@ void action_run_full(ObAction *a, struct _ObClient *c,
         a->data.inter.cancel = cancel;
         a->data.inter.final = done;
         if (!(cancel || done))
-            keyboard_interactive_grab(state, c, context, a);
+            keyboard_interactive_grab(state, c, a);
     }
 
     a->func(&a->data);
@@ -866,9 +868,11 @@ void action_raise(union ActionData *data)
 void action_unshaderaise(union ActionData *data)
 {
     if (data->client.any.c) {
-        if (data->client.any.c->shaded)
+        if (data->client.any.c->shaded) {
+            grab_pointer(TRUE, OB_CURSOR_NONE);
             client_shade(data->client.any.c, FALSE);
-        else
+            grab_pointer(FALSE, OB_CURSOR_NONE);
+        } else
             stacking_raise(CLIENT_AS_WINDOW(data->client.any.c));
     }
 }
@@ -878,8 +882,11 @@ void action_shadelower(union ActionData *data)
     if (data->client.any.c) {
         if (data->client.any.c->shaded)
             stacking_lower(CLIENT_AS_WINDOW(data->client.any.c));
-        else
+        else {
+            grab_pointer(TRUE, OB_CURSOR_NONE);
             client_shade(data->client.any.c, TRUE);
+            grab_pointer(FALSE, OB_CURSOR_NONE);
+        }
     }
 }
 
@@ -903,20 +910,29 @@ void action_kill(union ActionData *data)
 
 void action_shade(union ActionData *data)
 {
-    if (data->client.any.c)
+    if (data->client.any.c) { 
+        grab_pointer(TRUE, OB_CURSOR_NONE);
         client_shade(data->client.any.c, TRUE);
+        grab_pointer(FALSE, OB_CURSOR_NONE);
+    }
 }
 
 void action_unshade(union ActionData *data)
 {
-    if (data->client.any.c)
+    if (data->client.any.c) {
+        grab_pointer(TRUE, OB_CURSOR_NONE);
         client_shade(data->client.any.c, FALSE);
+        grab_pointer(FALSE, OB_CURSOR_NONE);
+    }
 }
 
 void action_toggle_shade(union ActionData *data)
 {
-    if (data->client.any.c)
+    if (data->client.any.c) {
+        grab_pointer(TRUE, OB_CURSOR_NONE);
         client_shade(data->client.any.c, !data->client.any.c->shaded);
+        grab_pointer(FALSE, OB_CURSOR_NONE);
+    }
 }
 
 void action_toggle_omnipresent(union ActionData *data)
This page took 0.02154 seconds and 4 git commands to generate.