diff --git a/src/client.c b/src/client.c index 1b04b02..bcdb2a9 100644 --- a/src/client.c +++ b/src/client.c @@ -1021,6 +1021,7 @@ void client_moveresize(Client *c, XRectangle geo, Bool r) { int os, e; + int rhx = 0, rhy = 0; if(!c) return; @@ -1050,8 +1051,14 @@ client_moveresize(Client *c, XRectangle geo, Bool r) /* Apply geometry hints */ if(r) + { client_geo_hints(&geo, c); + /* To balance position of window in frame */ + rhx = ((c->wrgeo.width) - geo.width) / 2; + rhy = ((c->wrgeo.height) - geo.height) / 2; + } + c->geo = geo; /* Sett free_geo */ @@ -1066,7 +1073,7 @@ client_moveresize(Client *c, XRectangle geo, Bool r) frame_moveresize(c, c->wrgeo); - XMoveResizeWindow(dpy, c->win, BORDH, TBARH, c->geo.width, c->geo.height); + XMoveResizeWindow(dpy, c->win, BORDH + rhx, TBARH + rhy, c->geo.width, c->geo.height); client_update_attributes(c); client_configure(c); diff --git a/src/layout.c b/src/layout.c index 291b47f..46474fc 100644 --- a/src/layout.c +++ b/src/layout.c @@ -778,12 +778,15 @@ uicb_togglemax(uicb_t cmd) void uicb_toggle_resizehint(uicb_t cmd) { + Client *c; + screen_get_sel(); (void)cmd; tags[selscreen][seltag[selscreen]].resizehint = !tags[selscreen][seltag[selscreen]].resizehint; - tags[selscreen][seltag[selscreen]].layout.func(selscreen); + for(c = tiled_client(selscreen, clients); c; c = tiled_client(selscreen, c->next)) + client_moveresize(c, c->geo, tags[selscreen][seltag[selscreen]].resizehint); return; } diff --git a/src/tag.c b/src/tag.c index 511d23d..7fb07c1 100644 --- a/src/tag.c +++ b/src/tag.c @@ -500,6 +500,8 @@ tag_additional(int sc, int tag, int adtag) tags[sc][tag].tagad ^= TagFlag(adtag); tags[sc][adtag].request_update = True; + tags[sc][tag].cleanfact = True; + tags[sc][adtag].cleanfact = True; arrange(sc, True); return;