Client/Layout/Tag: Balance position of window in frame with resizehint, refresh only client size at resizehint toggle and fix layout with tag additional

This commit is contained in:
Martin Duquesnoy 2011-05-14 15:19:02 +02:00
parent f606b5ba88
commit dc836ccb86
3 changed files with 14 additions and 2 deletions

View File

@ -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);

View File

@ -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;
}

View File

@ -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;