X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=openbox%2Fclient.c;h=b5a66d3f0bd1682200e5b08d7f16e0be13d5a752;hb=9df57ff1b5c6f2bc631253cc8a51ec3af7d24d7e;hp=4d6a580797f68d8a1bdbc62a134e5f7dd765e6ee;hpb=03cad5d97cedc87728ec1ba8e39cbdba12ad756c;p=chaz%2Fopenbox diff --git a/openbox/client.c b/openbox/client.c index 4d6a5807..b5a66d3f 100644 --- a/openbox/client.c +++ b/openbox/client.c @@ -349,10 +349,19 @@ void client_manage(Window window) self->frame->area.width, self->frame->area.height, /* non-normal clients has less rules, and - windows that are being restored from a session - do also. we can assume you want it back where - you saved it */ - client_normal(self) && !self->session); + windows that are being restored from a + session do also. we can assume you want + it back where you saved it. Clients saying + they placed themselves are subjected to + harder rules, ones that are placed by + place.c or by the user are allowed partially + off-screen and on xinerama divides (ie, + it is up to the placement routines to avoid + the xinerama divides) */ + ((self->positioned & PPosition) && + !(self->positioned & USPosition)) && + client_normal(self) && + !self->session); if (x != ox || y != oy) client_move(self, x, y); } @@ -543,7 +552,7 @@ static void client_restore_session_state(ObClient *self) self->session = it->data; RECT_SET_POINT(self->area, self->session->x, self->session->y); - self->positioned = TRUE; + self->positioned = PPosition; if (self->session->w > 0) self->area.width = self->session->w; if (self->session->h > 0) @@ -612,8 +621,8 @@ gboolean client_find_onscreen(ObClient *self, gint *x, gint *y, gint w, gint h, /* XXX watch for xinerama dead areas */ /* This makes sure windows aren't entirely outside of the screen so you * can't see them at all */ - a = screen_area(self->desktop); if (client_normal(self)) { + a = screen_area(self->desktop); if (!self->strut.right && *x >= a->x + a->width - 1) *x = a->x + a->width - self->frame->area.width; if (!self->strut.bottom && *y >= a->y + a->height - 1) @@ -625,16 +634,16 @@ gboolean client_find_onscreen(ObClient *self, gint *x, gint *y, gint w, gint h, } /* This here doesn't let windows even a pixel outside the screen, - * not applied to all windows. Not sure if it's going to stay at all. - * I wonder if disabling this will break struts somehow? Let's find out. */ - if (0 && rude) { + * when called from client_manage, programs placing themselves are + * forced completely onscreen, while things like + * xterm -geometry resolution-width/2 will work fine. Trying to + * place it completely offscreen will be handled in the above code. + * Sorry for this confused comment, i am tired. */ + if (rude) { /* avoid the xinerama monitor divide while we're at it, * remember to fix the placement stuff to avoid it also and * then remove this XXX */ a = screen_physical_area_monitor(client_monitor(self)); - /* this is ben's MOZILLA BITCHSLAP. "oh ya it fucking feels good. - Java can suck it too." */ - /* dont let windows map/move into the strut unless they are bigger than the available area */ if (w <= a->width) { @@ -1118,7 +1127,7 @@ void client_update_normal_hints(ObClient *self) /* normal windows can't request placement! har har if (!client_normal(self)) */ - self->positioned = !!(size.flags & (PPosition|USPosition)); + self->positioned = (size.flags & (PPosition|USPosition)); if (size.flags & PWinGravity) { self->gravity = size.win_gravity;