]> Dogcows Code - chaz/openbox/commitdiff
client_configure_full is trying to move a window, it shouldn't determine the window...
authorDana Jansens <danakj@orodu.net>
Sun, 11 Mar 2007 17:34:07 +0000 (17:34 +0000)
committerDana Jansens <danakj@orodu.net>
Sun, 11 Mar 2007 17:34:07 +0000 (17:34 +0000)
openbox/client.c
openbox/screen.c
openbox/screen.h

index 5bc79847287578643ddf26a0550628ce89fb8160..5896ece0ffc7f58d6fe49b09f467a425cf04e9cf 100644 (file)
@@ -2105,6 +2105,7 @@ void client_configure_full(ObClient *self, ObCorner anchor,
     gboolean moved = FALSE, resized = FALSE;
     guint fdecor = self->frame->decorations;
     gboolean fhorz = self->frame->max_horz;
+    Rect desired_area = {x, y, w, h};
 
     /* make the frame recalculate its dimentions n shit without changing
        anything visible for real, this way the constraints below can work with
@@ -2121,7 +2122,7 @@ void client_configure_full(ObClient *self, ObCorner anchor,
         Rect *a;
         guint i;
 
-        i = client_monitor(self);
+        i = screen_find_monitor(&desired_area);
         a = screen_physical_area_monitor(i);
 
         x = a->x;
@@ -2132,8 +2133,10 @@ void client_configure_full(ObClient *self, ObCorner anchor,
         user = FALSE; /* ignore that increment etc shit when in fullscreen */
     } else {
         Rect *a;
+        guint i;
 
-        a = screen_area_monitor(self->desktop, client_monitor(self));
+        i = screen_find_monitor(&desired_area);
+        a = screen_area_monitor(self->desktop, i);
 
         /* set the size and position if maximized */
         if (self->max_horz) {
@@ -3204,31 +3207,9 @@ void client_set_undecorated(ObClient *self, gboolean undecorated)
     }
 }
 
-/* Determines which physical monitor a client is on by calculating the
-   area of the part of the client on each monitor.  The number of the
-   monitor containing the greatest area of the client is returned.*/
 guint client_monitor(ObClient *self)
 {
-    guint i;
-    guint most = 0;
-    guint mostv = 0;
-
-    for (i = 0; i < screen_num_monitors; ++i) {
-        Rect *area = screen_physical_area_monitor(i);
-        if (RECT_INTERSECTS_RECT(*area, self->frame->area)) {
-            Rect r;
-            guint v;
-
-            RECT_SET_INTERSECTION(r, *area, self->frame->area);
-            v = r.width * r.height;
-
-            if (v > mostv) {
-                mostv = v;
-                most = i;
-            }
-        }
-    }
-    return most;
+    return screen_find_monitor(&self->frame->area);
 }
 
 GSList *client_search_top_transients(ObClient *self)
index d97a732b58e3a1dad883a929c48ee0a73cfe709b..3542dfdc3a76512f3c6de1274da386fab5ae959f 100644 (file)
@@ -1172,6 +1172,30 @@ Rect *screen_area_monitor(guint desktop, guint head)
     return &area[desktop][head];
 }
 
+guint screen_find_monitor(Rect *search)
+{
+    guint i;
+    guint most = 0;
+    guint mostv = 0;
+
+    for (i = 0; i < screen_num_monitors; ++i) {
+        Rect *area = screen_physical_area_monitor(i);
+        if (RECT_INTERSECTS_RECT(*area, *search)) {
+            Rect r;
+            guint v;
+
+            RECT_SET_INTERSECTION(r, *area, *search);
+            v = r.width * r.height;
+
+            if (v > mostv) {
+                mostv = v;
+                most = i;
+            }
+        }
+    }
+    return most;
+}
+
 Rect *screen_physical_area()
 {
     return screen_physical_area_monitor(screen_num_monitors);
index 5e9b5670b779b945d87365b6184810323bf06a39..07a2cae02dda036716a621feb724094d4d52f6d8 100644 (file)
@@ -96,6 +96,11 @@ Rect *screen_area(guint desktop);
 
 Rect *screen_area_monitor(guint desktop, guint head);
 
+/*! Determines which physical monitor a rectangle is on by calculating the
+    area of the part of the rectable on each monitor.  The number of the
+    monitor containing the greatest area of the rectangle is returned.*/
+guint screen_find_monitor(Rect *search);
+
 /*! Sets the root cursor. This function decides which cursor to use, but you
   gotta call it to let it know it should change. */
 void screen_set_root_cursor();
This page took 0.029635 seconds and 4 git commands to generate.