]> Dogcows Code - chaz/openbox/commitdiff
return if the window was restacked
authorDana Jansens <danakj@orodu.net>
Sun, 3 Jun 2007 17:55:49 +0000 (17:55 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 3 Jun 2007 17:55:49 +0000 (17:55 +0000)
openbox/stacking.c
openbox/stacking.h

index 5d01e5e925faa82467edee6254e80c3633bb0bf1..075f13868b5e303cf10e231a1eacc6572eaf7ce6 100644 (file)
@@ -551,9 +551,11 @@ static gboolean stacking_occludes(ObClient *client, ObClient *sibling)
     return occludes;
 }
 
-void stacking_restack_request(ObClient *client, ObClient *sibling,
-                              gint detail, gboolean activate)
+gboolean stacking_restack_request(ObClient *client, ObClient *sibling,
+                                  gint detail, gboolean activate)
 {
+    gboolean ret = FALSE;
+
     if (sibling && ((client->desktop != sibling->desktop &&
                      client->desktop != DESKTOP_ALL &&
                      sibling->desktop != DESKTOP_ALL) ||
@@ -570,6 +572,7 @@ void stacking_restack_request(ObClient *client, ObClient *sibling,
                  client->title, sibling ? sibling->title : "(all)");
         /* just lower it */
         stacking_lower(CLIENT_AS_WINDOW(client));
+        ret = TRUE;
         break;
     case BottomIf:
         ob_debug("Restack request BottomIf for client %s sibling "
@@ -577,8 +580,10 @@ void stacking_restack_request(ObClient *client, ObClient *sibling,
                  client->title, sibling ? sibling->title : "(all)");
         /* if this client occludes sibling (or anything if NULL), then
            lower it to the bottom */
-        if (stacking_occludes(client, sibling))
+        if (stacking_occludes(client, sibling)) {
             stacking_lower(CLIENT_AS_WINDOW(client));
+            ret = TRUE;
+        }
         break;
     case Above:
         ob_debug("Restack request Above for client %s sibling %s\n",
@@ -589,6 +594,7 @@ void stacking_restack_request(ObClient *client, ObClient *sibling,
             client_activate(client, FALSE, TRUE);
         else
             stacking_raise(CLIENT_AS_WINDOW(client));
+        ret = TRUE;
         break;
     case TopIf:
         ob_debug("Restack request TopIf for client %s sibling %s\n",
@@ -600,6 +606,7 @@ void stacking_restack_request(ObClient *client, ObClient *sibling,
                 client_activate(client, FALSE, TRUE);
             else
                 stacking_raise(CLIENT_AS_WINDOW(client));
+            ret = TRUE;
         }
         break;
     case Opposite:
@@ -613,9 +620,13 @@ void stacking_restack_request(ObClient *client, ObClient *sibling,
                 client_activate(client, FALSE, TRUE);
             else
                 stacking_raise(CLIENT_AS_WINDOW(client));
+            ret = TRUE;
         }
-        else if (stacking_occludes(client, sibling))
+        else if (stacking_occludes(client, sibling)) {
             stacking_lower(CLIENT_AS_WINDOW(client));
+            ret = TRUE;
+        }
         break;
     }
+    return ret;
 }
index eb638734c242b47f35859b1830f40e1a9d3a26b0..bf2f56b48be2dfc59e5e76cd9f787251be0be298 100644 (file)
@@ -67,11 +67,12 @@ void stacking_below(ObWindow *window, ObWindow *below);
   @param detail One of Above, Below, TopIf, BottomIf, Opposite
   @param activate If TRUE, and if the window is going to be raised, it will
                   be activated instead
+  @return TRUE if the client was restacked
   See http://tronche.com/gui/x/xlib/window/configure.html for details on
   how each detail works with and without a sibling.
 */
-void stacking_restack_request(struct _ObClient *client,
-                              struct _ObClient *sibling,
-                              gint detail, gboolean activate);
+gboolean stacking_restack_request(struct _ObClient *client,
+                                  struct _ObClient *sibling,
+                                  gint detail, gboolean activate);
 
 #endif
This page took 0.029231 seconds and 4 git commands to generate.