]> Dogcows Code - chaz/openbox/commitdiff
2 passes at smart placement
authorDana Jansens <danakj@orodu.net>
Mon, 15 Sep 2003 04:32:06 +0000 (04:32 +0000)
committerDana Jansens <danakj@orodu.net>
Mon, 15 Sep 2003 04:32:06 +0000 (04:32 +0000)
openbox/place.c

index 6fc1bd18741d23278e3e61761a2a4e7734dd55f8..af90bb61eba87339d95e2c71cdbd81920bc1648c 100644 (file)
@@ -133,7 +133,8 @@ static gint area_cmp(gconstpointer p1, gconstpointer p2)
     return ret;
 }
 
-static gboolean place_smart(ObClient *client, gint *x, gint *y)
+static gboolean place_smart(ObClient *client, gint *x, gint *y,
+                            gboolean only_focused)
 {
     guint i;
     gboolean ret = FALSE;
@@ -151,7 +152,8 @@ static gboolean place_smart(ObClient *client, gint *x, gint *y)
 
         if (c != client && !c->shaded && client_normal(c)) {
             spaces = area_remove(spaces, &c->frame->area);
-            break;
+            if (only_focused)
+                break;
         }
     }
 
@@ -269,9 +271,10 @@ void place_client(ObClient *client, gint *x, gint *y)
 {
     if (client->positioned)
         return;
-    if (place_transient(client, x, y) ||
-        place_dialog(client, x, y)    ||
-        place_smart(client, x, y)     ||
+    if (place_transient(client, x, y)    ||
+        place_dialog(client, x, y)       ||
+        place_smart(client, x, y, FALSE) ||
+        place_smart(client, x, y, TRUE)  ||
         (config_focus_follow ?
          place_under_mouse(client, x, y) :
          place_random(client, x, y)))
This page took 0.023688 seconds and 4 git commands to generate.