all repos — openbox @ 80120d04874bdbdd429016fe8db256cebac9812b

openbox fork - make it a bit more like ryudo

don't force oldschool fullscreen windows to move inside struts (fixes acroread some more, along with previous commit)
Dana Jansens danakj@orodu.net
commit

80120d04874bdbdd429016fe8db256cebac9812b

parent

44802ea327236a310b9a6f13dd72b3671825781b

1 files changed, 37 insertions(+), 35 deletions(-)

jump to
M openbox/client.copenbox/client.c

@@ -213,8 +213,8 @@ XSetWindowAttributes attrib_set;

XWMHints *wmhint; gboolean activate = FALSE; ObAppSettings *settings; - gint placex, placey, placew, placeh; gboolean transient = FALSE; + Rect place, *monitor; grab_server(TRUE);

@@ -337,10 +337,8 @@ frame_adjust_area(self->frame, FALSE, TRUE, FALSE);

frame_adjust_client_area(self->frame); /* where the frame was placed is where the window was originally */ - placex = self->area.x; - placey = self->area.y; - placew = self->area.width; - placeh = self->area.height; + place = self->area; + monitor = screen_physical_area_monitor(screen_find_monitor(&place)); /* figure out placement for the window if the window is new */ if (ob_state() == OB_STATE_RUNNING) {

@@ -350,7 +348,7 @@ (self->positioned == PPosition ? "program specified" :

(self->positioned == USPosition ? "user specified" : (self->positioned == (PPosition | USPosition) ? "program + user specified" : - "BADNESS !?")))), placex, placey); + "BADNESS !?")))), place.x, place.y); ob_debug("Sized: %s @ %d %d\n", (!self->sized ? "no" :

@@ -358,14 +356,15 @@ (self->sized == PSize ? "program specified" :

(self->sized == USSize ? "user specified" : (self->sized == (PSize | USSize) ? "program + user specified" : - "BADNESS !?")))), placew, placeh); + "BADNESS !?")))), place.width, place.height); /* splash screens are also returned as TRUE for transient, and so will be forced on screen below */ - transient = place_client(self, &placex, &placey, settings); + transient = place_client(self, &place.x, &place.y, settings); /* make sure the window is visible. */ - client_find_onscreen(self, &placex, &placey, placew, placeh, + client_find_onscreen(self, &place.x, &place.y, + place.width, place.height, /* non-normal clients has less rules, and windows that are being restored from a session do also. we can assume you want

@@ -385,7 +384,13 @@ (transient ||

(!((self->positioned & USPosition) || (settings && settings->pos_given)) && client_normal(self) && - !self->session))); + !self->session && + /* don't move 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) */ + !(self->decorations == 0 && + RECT_EQUAL(place, *monitor))))); } /* if the window isn't user-sized, then make it fit inside

@@ -401,41 +406,34 @@ if (ob_state() == OB_STATE_RUNNING &&

(transient || (!(self->sized & USSize || self->positioned & USPosition) && client_normal(self) && - !self->session))) + !self->session && + /* 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) */ + !(self->decorations == 0 && RECT_EQUAL(place, *monitor))))) { - Rect *monitor, *a, placer; - - monitor = screen_physical_area_monitor(client_monitor(self)); + Rect *a = screen_area(self->desktop, SCREEN_AREA_ONE_MONITOR, &place); - RECT_SET(placer, placex, placey, placew, placeh); - frame_rect_to_frame(self->frame, &placer); + /* get the size of the frame */ + place.width += self->frame->size.left + self->frame->size.right; + place.height += self->frame->size.top + self->frame->size.bottom; - a = screen_area(self->desktop, SCREEN_AREA_ONE_MONITOR, &placer); + /* fit the window inside the area */ + place.width = MIN(place.width, a->width); + place.height = MIN(place.height, a->height); - /* 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; + ob_debug("setting window size to %dx%d\n", place.width, place.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); + /* get the size of the client back */ + place.width -= self->frame->size.left + self->frame->size.right; + place.height -= self->frame->size.top + self->frame->size.bottom; - ob_debug("setting window size to %dx%d\n", placew, placeh); - } g_free(a); - g_free(monitor); } - ob_debug("placing window 0x%x at %d, %d with size %d x %d. " "some restrictions may apply\n", - self->window, placex, placey, placew, placeh); + self->window, place.x, place.y, place.width, place.height); if (self->session) ob_debug(" but session requested %d, %d %d x %d instead, " "overriding\n",

@@ -447,7 +445,11 @@ won't be all wacko!!

this also places the window */ - client_apply_startup_state(self, placex, placey, placew, placeh); + client_apply_startup_state(self, place.x, place.y, + place.width, place.height); + + g_free(monitor); + monitor = NULL; if (activate) { gboolean raise = FALSE;