From 44802ea327236a310b9a6f13dd72b3671825781b Mon Sep 17 00:00:00 2001 From: Dana Jansens Date: Wed, 1 Aug 2007 18:54:02 -0400 Subject: [PATCH] fix for acroread - don't shrink windows when they specifically fit an entire monitor --- openbox/client.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-) diff --git a/openbox/client.c b/openbox/client.c index 712df3a5..ca85db61 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -403,26 +403,33 @@ void client_manage(Window window) client_normal(self) && !self->session))) { - Rect placer; + Rect *monitor, *a, placer; + + monitor = screen_physical_area_monitor(client_monitor(self)); RECT_SET(placer, placex, placey, placew, placeh); frame_rect_to_frame(self->frame, &placer); - Rect *a = screen_area(self->desktop, SCREEN_AREA_ONE_MONITOR, &placer); + a = screen_area(self->desktop, SCREEN_AREA_ONE_MONITOR, &placer); /* shrink by the frame's area */ a->width -= self->frame->size.left + self->frame->size.right; a->height -= self->frame->size.top + self->frame->size.bottom; - /* fit the window inside the area */ - if (placew > a->width || self->area.height > a->height) { + /* fit the window inside the area + but, don't shrink oldschool fullscreen windows to fit inside the + struts (fixes Acroread, which makes its fullscreen window + fit the screen but it is not USSize'd or USPosition'd) */ + if ((placew > a->width || self->area.height > a->height) && + !(self->decorations == 0 && RECT_EQUAL(placer, *monitor))) + { placew = MIN(self->area.width, a->width); placeh = MIN(self->area.height, a->height); - ob_debug("setting window size to %dx%d\n", - self->area.width, self->area.height); + ob_debug("setting window size to %dx%d\n", placew, placeh); } g_free(a); + g_free(monitor); } -- 2.39.2