diff --git a/client.c b/client.c index 3dbfcef8..7b105d81 100644 --- a/client.c +++ b/client.c @@ -500,12 +500,15 @@ client_resize(Client *c, area_t geometry, Bool hints) XWindowChanges wc; Layout *layout = layout_get_current(c->screen); + if(!c->ismoving && !c->isfloating && layout->arrange != layout_floating) + { + titlebar_update_geometry(c, geometry); + geometry = titlebar_geometry_remove(&c->titlebar, geometry); + } + if(hints) geometry = client_geometry_hints(c, geometry); - if(!c->ismoving && !c->isfloating && layout->arrange != layout_floating) - geometry = titlebar_update_geometry(c, geometry); - if(geometry.width <= 0 || geometry.height <= 0) return False; @@ -543,6 +546,12 @@ client_resize(Client *c, area_t geometry, Bool hints) c->f_geometry = geometry; titlebar_update_geometry_floating(c); } + /* call it again like it was floating, + * because for right or bottom titlebar, + * we want it to be sticked to the window */ + else if(!c->ismoving && !c->isfloating && layout->arrange != layout_floating + && (c->titlebar.position == Right || c->titlebar.position == Bottom)) + titlebar_update_geometry_floating(c); XConfigureWindow(globalconf.display, c->win, CWX | CWY | CWWidth | CWHeight | CWBorderWidth, &wc); diff --git a/titlebar.c b/titlebar.c index 0732f726..3733c2e0 100644 --- a/titlebar.c +++ b/titlebar.c @@ -336,18 +336,18 @@ titlebar_update_geometry_floating(Client *c) titlebar_update(c); } -area_t +void titlebar_update_geometry(Client *c, area_t geometry) { int width, x_offset = 0 , y_offset = 0; if(!c->titlebar.sw) - return geometry; + return; switch(c->titlebar.position) { default: - return geometry; + return; case Top: if(!c->titlebar.width) width = geometry.width + 2 * c->border; @@ -441,8 +441,6 @@ titlebar_update_geometry(Client *c, area_t geometry) } titlebar_update(c); - - return titlebar_geometry_remove(&c->titlebar, geometry); } /** Toggle window titlebar visibility diff --git a/titlebar.h b/titlebar.h index fdd39d13..247981c2 100644 --- a/titlebar.h +++ b/titlebar.h @@ -27,7 +27,7 @@ void titlebar_init(Client *); void titlebar_update(Client *); void titlebar_update_geometry_floating(Client *); -area_t titlebar_update_geometry(Client *, area_t); +void titlebar_update_geometry(Client *, area_t); area_t titlebar_geometry_add(Titlebar *, area_t); area_t titlebar_geometry_remove(Titlebar *, area_t);