]> Dogcows Code - chaz/openbox/blobdiff - openbox/client.c
expose focus_cycle_client
[chaz/openbox] / openbox / client.c
index fe23f05df94f017af187122ac5a4da59b6f254f2..197be7cc6af662eafa2496bf7034ce550f4e9b6a 100644 (file)
@@ -1756,6 +1756,8 @@ void client_configure_full(ObClient *self, ObCorner anchor,
                            gboolean user, gboolean final,
                            gboolean force_reply)
 {
+    gint oldw, oldh;
+    gboolean send_resize_client;
     gboolean moved = FALSE, resized = FALSE;
     guint fdecor = self->frame->decorations;
     gboolean fhorz = self->frame->max_horz;
@@ -1917,14 +1919,20 @@ void client_configure_full(ObClient *self, ObCorner anchor,
     moved = x != self->area.x || y != self->area.y;
     resized = w != self->area.width || h != self->area.height;
 
+    oldw = self->area.width;
+    oldh = self->area.height;
     RECT_SET(self->area, x, y, w, h);
 
     /* for app-requested resizes, always resize if 'resized' is true.
        for user-requested ones, only resize if final is true, or when
        resizing in redraw mode */
-    if ((!user && resized) ||
-        (user && (final || (resized && config_redraw_resize))))
-       XResizeWindow(ob_display, self->window, w, h);
+    send_resize_client = ((!user && resized) ||
+                          (user && (final ||
+                                    (resized && config_redraw_resize))));
+
+    /* if the client is enlarging, the resize the client before the frame */
+    if (send_resize_client && (w > oldw || h > oldh))
+       XResizeWindow(ob_display, self->window, MAX(w, oldw), MAX(h, oldh));
 
     /* move/resize the frame to match the request */
     if (self->frame) {
@@ -1956,6 +1964,12 @@ void client_configure_full(ObClient *self, ObCorner anchor,
                        FALSE, StructureNotifyMask, &event);
        }
     }
+
+    /* if the client is shrinking, then resize the frame before the client */
+    if (send_resize_client && (w <= oldw || h <= oldh))
+       XResizeWindow(ob_display, self->window, w, h);
+
+    XFlush(ob_display);
 }
 
 void client_fullscreen(ObClient *self, gboolean fs, gboolean savearea)
This page took 0.021544 seconds and 4 git commands to generate.