X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=197be7cc6af662eafa2496bf7034ce550f4e9b6a;hb=e68e6c6a536a2132570ddf1d1d3759bb31ef781e;hp=fe23f05df94f017af187122ac5a4da59b6f254f2;hpb=9f2a844beb62287e12e75bf207e4c55bc14b6209;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index fe23f05d..197be7cc 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -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)