all repos — openbox @ 829e746b4defb3776050c438fa4fa87e5242eb25

openbox fork - make it a bit more like ryudo

fix programs showing their child windows outside the screen, but retain the possibility to put windows slightly offscreen with the -geometry argument (which is why i broke it in the first place)
Mikael Magnusson mikachu@comhem.se
commit

829e746b4defb3776050c438fa4fa87e5242eb25

parent

3b83230aafd70dafc97fe1a148873a948044ed9c

2 files changed, 17 insertions(+), 9 deletions(-)

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

@@ -351,8 +351,11 @@ 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); + you saved it. Clients saying the user placed + them are also spared from the evil rules */ + !(self->positioned & USPosition) && + client_normal(self) && + !self->session); if (x != ox || y != oy) client_move(self, x, y); }

@@ -543,7 +546,7 @@

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)

@@ -625,9 +628,12 @@ *y = a->y;

} /* 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 */

@@ -1118,7 +1124,7 @@ if (XGetWMNormalHints(ob_display, self->window, &size, &ret)) {

/* 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;
M openbox/client.hopenbox/client.h

@@ -201,9 +201,11 @@

/*! True if the client supports the delete_window protocol */ gboolean delete_window; - /*! Was the window's position requested by the application? if not, we + /*! Was the window's position requested by the application or the user? + if by the application, we force it completely onscreen, if by the user + we only force it if it tries to go completely offscreen, if neither, we should place the window ourselves when it first appears */ - gboolean positioned; + guint positioned; /*! Can the window receive input focus? */ gboolean can_focus;