all repos — openbox @ a0941554f6cfc29dfd4b0da0b5ce83fdd719efa7

openbox fork - make it a bit more like ryudo

fix showing the resize cursors at the right times.
fix losing the pre-size/position for windows mapped maximized or fullscreen states (and on restart)
Dana Jansens danakj@orodu.net
commit

a0941554f6cfc29dfd4b0da0b5ce83fdd719efa7

parent

c5508ec16f094847781188812784eb312d691401

2 files changed, 32 insertions(+), 28 deletions(-)

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

@@ -403,20 +403,26 @@ frame_adjust_area(self->frame, FALSE, TRUE, FALSE);

frame_adjust_client_area(self->frame); + /* do this after the window is placed, so the premax/prefullscreen numbers + won't be all wacko!! + also, this moves the window to the position where it has been placed + */ + client_apply_startup_state(self); + /* move the client to its placed position, or it it's already there, generate a ConfigureNotify telling the client where it is. do this after adjusting the frame. otherwise it gets all weird and - clients don't work right */ + clients don't work right + + also do this after applying the startup state so maximize and fullscreen + will get the right sizes and positions if the client is starting with + those states + */ client_configure(self, self->area.x, self->area.y, self->area.width, self->area.height, FALSE, TRUE); - /* do this after the window is placed, so the premax/prefullscreen numbers - won't be all wacko!! - also, this moves the window to the position where it has been placed - */ - client_apply_startup_state(self); if (activate) { guint32 last_time = focus_client ?

@@ -1584,6 +1590,8 @@ SIZE_SET(self->size_inc, size.width_inc, size.height_inc);

} } +/*! This needs to be followed by a call to client_configure to make + the changes show */ void client_setup_decor_and_functions(ObClient *self) { /* start with everything (cept fullscreen) */

@@ -1704,14 +1712,9 @@ self->functions &= ~OB_CLIENT_FUNC_MAXIMIZE;

self->decorations &= ~OB_FRAME_DECOR_MAXIMIZE; } - if (self->max_horz && self->max_vert) { - /* also can't resize maximized windows. - do this after checking for resize to let you maximize */ - self->functions &=~ OB_CLIENT_FUNC_RESIZE; - + if (self->max_horz && self->max_vert) /* kill the handle on fully maxed windows */ self->decorations &= ~(OB_FRAME_DECOR_HANDLE | OB_FRAME_DECOR_GRIPS); - } /* If there are no decorations to remove, don't allow the user to try toggle the state */

@@ -1740,11 +1743,6 @@ self->decorations = 0;

} client_change_allowed_actions(self); - - if (self->frame) { - /* adjust the client's decorations, etc. */ - client_reconfigure(self); - } } static void client_change_allowed_actions(ObClient *self)

@@ -3615,6 +3613,7 @@ (self->functions & OB_CLIENT_FUNC_UNDECORATE || !undecorated))

{ self->undecorated = undecorated; client_setup_decor_and_functions(self); + client_reconfigure(self); /* show the lack of decorations */ client_change_state(self); /* reflect this in the state hints */ } }
M openbox/frame.copenbox/frame.c

@@ -55,6 +55,7 @@ static void layout_title(ObFrame *self);

static void set_theme_statics(ObFrame *self); static void free_theme_statics(ObFrame *self); static gboolean frame_animate_iconify(gpointer self); +static void frame_adjust_cursors(ObFrame *self); static Window createWindow(Window parent, Visual *visual, gulong mask, XSetWindowAttributes *attrib)

@@ -329,7 +330,13 @@

oldsize = self->size; if (resized) { + /* do this before changing the frame's status like max_horz max_vert */ + frame_adjust_cursors(self); + + self->functions = self->client->functions; self->decorations = self->client->decorations; + self->max_horz = self->client->max_horz; + self->max_vert = self->client->max_vert; if (self->decorations & OB_FRAME_DECOR_BORDER) { self->bwidth = ob_rr_theme->fbwidth;

@@ -339,9 +346,6 @@ } else {

self->bwidth = self->cbwidth_x = self->cbwidth_y = 0; } self->rbwidth = self->bwidth; - - self->max_horz = self->client->max_horz; - self->max_vert = self->client->max_vert; if (self->max_horz) { self->cbwidth_x = 0;

@@ -740,14 +744,17 @@ }

if (resized && (self->decorations & OB_FRAME_DECOR_TITLEBAR)) XResizeWindow(ob_display, self->label, self->label_width, ob_rr_theme->label_height); +} - /* set up cursors */ - if (!fake && - (self->functions & OB_CLIENT_FUNC_RESIZE) != - (self->client->functions & OB_CLIENT_FUNC_RESIZE)) +static void frame_adjust_cursors(ObFrame *self) +{ + if ((self->functions & OB_CLIENT_FUNC_RESIZE) != + (self->client->functions & OB_CLIENT_FUNC_RESIZE) || + ((self->max_horz && self->max_vert) != + (self->client->max_horz && self->client->max_vert))) { - gboolean r = self->client->functions & OB_CLIENT_FUNC_RESIZE && - !(self->max_horz && self->max_vert); + gboolean r = (self->client->functions & OB_CLIENT_FUNC_RESIZE) && + !(self->client->max_horz && self->client->max_vert); XSetWindowAttributes a; a.cursor = ob_cursor(r ? OB_CURSOR_NORTH : OB_CURSOR_NONE);

@@ -783,8 +790,6 @@ XChangeWindowAttributes(ob_display, self->handleright, CWCursor, &a);

XChangeWindowAttributes(ob_display, self->rgripright, CWCursor, &a); XChangeWindowAttributes(ob_display, self->rgriptop, CWCursor, &a); XChangeWindowAttributes(ob_display, self->rgripbottom, CWCursor, &a); - - self->functions = self->client->functions; } }