From 2494762dbf89e0ea8eb72c460c6f7281fa0a2204 Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Tue, 5 Aug 2003 10:31:20 +0000 Subject: a couple frame layout bugfixes hidden inside all this.. wee fixes for maximizing windows: - when you toggledecor, it will reconfigure once, but the new constraints from the decor changes would not be in effect when the window was resized to the contranits. fixed by calling frame_adjust_area first thing ni client_configure_fulll with fake=TRUE which will recalc all the frame geometry without resizing/redrawing anything in the frame. this way the decor can take effect in the geometries. - when maxed horizontally, make the client fill the screen, but dont do this by just making it wider than the screen, fit it to the screen and adjust the titlebar/handle as appropriate to keep it all on the screen. - when maxed horizontally and vertically, remove the handle from the decorations --- openbox/client.c | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) (limited to 'openbox/client.c') diff --git a/openbox/client.c b/openbox/client.c index ebff0bae..685545a6 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -1712,6 +1712,11 @@ void client_configure_full(ObClient *self, ObCorner anchor, { gboolean moved = FALSE, resized = FALSE; + /* make the frame recalculate its dimentions n shit without changing + anything visible for real, this way the constraints below can work with + the updated frame dimensions. */ + frame_adjust_area(self->frame, TRUE, TRUE, TRUE); + /* gets the frame's position */ frame_client_gravity(self->frame, &x, &y); @@ -1757,8 +1762,8 @@ void client_configure_full(ObClient *self, ObCorner anchor, /* set the size and position if maximized */ if (self->max_horz) { - x = a->x - self->frame->size.left; - w = a->width; + x = a->x; + w = a->width - self->frame->size.left - self->frame->size.right; } if (self->max_vert) { y = a->y; @@ -1900,7 +1905,7 @@ void client_configure_full(ObClient *self, ObCorner anchor, moved = resized = TRUE; if (moved || resized) - frame_adjust_area(self->frame, moved, resized); + frame_adjust_area(self->frame, moved, resized, FALSE); if (!resized && (force_reply || ((!user && moved) || (user && final)))) { @@ -2170,7 +2175,7 @@ void client_shade(ObClient *self, gboolean shade) self->shaded = shade; client_change_state(self); /* resize the frame to just the titlebar */ - frame_adjust_area(self->frame, FALSE, FALSE); + frame_adjust_area(self->frame, FALSE, FALSE, FALSE); } void client_close(ObClient *self) -- cgit v1.2.3