summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDana Jansens <danakj@orodu.net>2007-08-01 18:54:02 -0400
committerDana Jansens <danakj@orodu.net>2007-08-01 18:54:02 -0400
commit44802ea327236a310b9a6f13dd72b3671825781b (patch)
treeba583b05b79595584d64c1962e078d9c4fc630e2
parent7c7bfd770d4fa0d83324619110b4056b4434fe80 (diff)
fix for acroread - don't shrink windows when they specifically fit an entire monitor
-rw-r--r--openbox/client.c19
1 files 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);
}