]> Dogcows Code - chaz/openbox/commitdiff
fully maximize windows all the time. size increments are preferred sizes not required...
authorDana Jansens <danakj@orodu.net>
Fri, 30 Mar 2007 04:37:53 +0000 (04:37 +0000)
committerDana Jansens <danakj@orodu.net>
Fri, 30 Mar 2007 04:37:53 +0000 (04:37 +0000)
-- http://tronche.com/gui/x/icccm/sec-4.html#s-4.1.2.3

openbox/client.c

index c9e09f54fd0d2b1ef76aee8719ed537bb88e5f23..80bc8a394d91efafbda5a00e8a0b891f15d6c1c9 100644 (file)
@@ -2163,58 +2163,7 @@ void client_try_configure(ObClient *self, ObCorner anchor,
        the updated frame dimensions. */
     frame_adjust_area(self->frame, TRUE, TRUE, TRUE);
 
-    /* gets the frame's position */
-    frame_client_gravity(self->frame, x, y);
-
-    /* these positions are frame positions, not client positions */
-
-    /* set the size and position if fullscreen */
-    if (self->fullscreen) {
-        Rect *a;
-        guint i;
-
-        i = screen_find_monitor(&desired_area);
-        a = screen_physical_area_monitor(i);
-
-        *x = a->x;
-        *y = a->y;
-        *w = a->width;
-        *h = a->height;
-
-        user = FALSE; /* ignore that increment etc shit when in fullscreen */
-    } else {
-        Rect *a;
-        guint i;
-
-        i = screen_find_monitor(&desired_area);
-        a = screen_area_monitor(self->desktop, i);
-
-        /* set the size and position if maximized */
-        if (self->max_horz) {
-            *x = a->x;
-            *w = a->width - self->frame->size.left - self->frame->size.right;
-        }
-        if (self->max_vert) {
-            *y = a->y;
-            *h = a->height - self->frame->size.top - self->frame->size.bottom;
-        }
-    }
-
-    /* gets the client's position */
-    frame_frame_gravity(self->frame, x, y);
-
-    /* these override the above states! if you cant move you can't move! */
-    if (user) {
-        if (!(self->functions & OB_CLIENT_FUNC_MOVE)) {
-            *x = self->area.x;
-            *y = self->area.y;
-        }
-        if (!(self->functions & OB_CLIENT_FUNC_RESIZE)) {
-            *w = self->area.width;
-            *h = self->area.height;
-        }
-    }
-
+    /* work within the prefered sizes given by the window */
     if (!(*w == self->area.width && *h == self->area.height)) {
         gint basew, baseh, minw, minh;
 
@@ -2297,6 +2246,62 @@ void client_try_configure(ObClient *self, ObCorner anchor,
         *h += self->base_size.height;
     }
 
+    /* gets the frame's position */
+    frame_client_gravity(self->frame, x, y);
+
+    /* these positions are frame positions, not client positions */
+
+    /* set the size and position if fullscreen */
+    if (self->fullscreen) {
+        Rect *a;
+        guint i;
+
+        i = screen_find_monitor(&desired_area);
+        a = screen_physical_area_monitor(i);
+
+        *x = a->x;
+        *y = a->y;
+        *w = a->width;
+        *h = a->height;
+
+        user = FALSE; /* ignore if the client can't be moved/resized when it
+                         is entering fullscreen */
+    } else if (self->max_horz || self->max_vert) {
+        Rect *a;
+        guint i;
+
+        i = screen_find_monitor(&desired_area);
+        a = screen_area_monitor(self->desktop, i);
+
+        /* set the size and position if maximized */
+        if (self->max_horz) {
+            *x = a->x;
+            *w = a->width - self->frame->size.left - self->frame->size.right;
+        }
+        if (self->max_vert) {
+            *y = a->y;
+            *h = a->height - self->frame->size.top - self->frame->size.bottom;
+        }
+
+        /* maximizing is not allowed if the user can't move+resize the window
+         */
+    }
+
+    /* gets the client's position */
+    frame_frame_gravity(self->frame, x, y);
+
+    /* these override the above states! if you cant move you can't move! */
+    if (user) {
+        if (!(self->functions & OB_CLIENT_FUNC_MOVE)) {
+            *x = self->area.x;
+            *y = self->area.y;
+        }
+        if (!(self->functions & OB_CLIENT_FUNC_RESIZE)) {
+            *w = self->area.width;
+            *h = self->area.height;
+        }
+    }
+
     g_assert(*w > 0);
     g_assert(*h > 0);
 
This page took 0.028995 seconds and 4 git commands to generate.