]> Dogcows Code - chaz/openbox/commitdiff
grab the pointer befoer shading a window to prevent focus moving in sloppy focus
authorDana Jansens <danakj@orodu.net>
Mon, 8 Sep 2003 17:25:51 +0000 (17:25 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 8 Sep 2003 17:25:51 +0000 (17:25 +0000)
openbox/action.c

index e0f411e0fa2a1b47ca1dc211c072f69a20224acc..6d1e0a645c9f068b2f3c4635d46807fe084892ee 100644 (file)
@@ -866,9 +866,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 +880,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 +908,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.025826 seconds and 4 git commands to generate.