Client/Layout: Add without-resizehint geo in client struct for split resize use, improve split size of clients.
This commit is contained in:
parent
f147bbbaf0
commit
391aae2dea
@ -885,7 +885,7 @@ client_manage(Window w, XWindowAttributes *wa, Bool ar)
|
||||
c->ogeo.y = c->geo.y = my;
|
||||
c->ogeo.width = c->geo.width = wa->width;
|
||||
c->ogeo.height = c->geo.height = wa->height;
|
||||
c->free_geo = c->pgeo = c->geo;
|
||||
c->free_geo = c->pgeo = c->wrgeo = c->geo;
|
||||
c->tag = seltag[c->screen];
|
||||
c->focusontag = -1;
|
||||
cfactor_clean(c);
|
||||
@ -1021,7 +1021,6 @@ void
|
||||
client_moveresize(Client *c, XRectangle geo, Bool r)
|
||||
{
|
||||
int os, e;
|
||||
XRectangle fg;
|
||||
|
||||
if(!c)
|
||||
return;
|
||||
@ -1046,7 +1045,8 @@ client_moveresize(Client *c, XRectangle geo, Bool r)
|
||||
|
||||
c->flags &= ~MaxFlag;
|
||||
|
||||
fg = geo;
|
||||
/* Set geo without resizehint applied */
|
||||
c->wrgeo = geo;
|
||||
|
||||
/* Apply geometry hints */
|
||||
if(r)
|
||||
@ -1064,7 +1064,7 @@ client_moveresize(Client *c, XRectangle geo, Bool r)
|
||||
&& c->tag != MAXTAG + 1)
|
||||
c->tag = seltag[c->screen];
|
||||
|
||||
frame_moveresize(c, fg);
|
||||
frame_moveresize(c, c->wrgeo);
|
||||
|
||||
XMoveResizeWindow(dpy, c->win, BORDH, TBARH, c->geo.width, c->geo.height);
|
||||
|
||||
|
||||
15
src/layout.c
15
src/layout.c
@ -885,21 +885,28 @@ layout_split_client(Client *c, Bool p)
|
||||
|
||||
cfactor_clean(c);
|
||||
|
||||
geo = sgeo = c->geo;
|
||||
/* Use geometry without resizehint applied on it */
|
||||
geo = sgeo = c->wrgeo;
|
||||
|
||||
/* Vertical */
|
||||
if(p)
|
||||
{
|
||||
geo.width /= 2;
|
||||
sgeo.width = (sgeo.width / 2) - (BORDH * 2);
|
||||
sgeo.x = FRAMEW(geo.x + geo.width);
|
||||
}
|
||||
sgeo.width = (sgeo.width / 2) - (BORDH * 2);
|
||||
|
||||
/* Remainder */
|
||||
sgeo.width += (c->wrgeo.x + c->wrgeo.width) - (sgeo.x + sgeo.width);
|
||||
}
|
||||
/* Horizontal */
|
||||
else
|
||||
{
|
||||
geo.height = (geo.height / 2) - TBARH;
|
||||
sgeo.height = (sgeo.height / 2) - BORDH;
|
||||
sgeo.y = FRAMEH(geo.y + geo.height);
|
||||
sgeo.height = (sgeo.height / 2) - BORDH;
|
||||
|
||||
/* Remainder */
|
||||
sgeo.height += (c->wrgeo.y + c->wrgeo.height) - (sgeo.y + sgeo.height);
|
||||
}
|
||||
|
||||
tags[c->screen][c->tag].layout.sgeo = sgeo;
|
||||
|
||||
@ -189,13 +189,11 @@ struct Client
|
||||
/* Screen */
|
||||
int screen;
|
||||
/* Window attribute */
|
||||
XRectangle geo, pgeo;
|
||||
XRectangle tmp_geo;
|
||||
XRectangle frame_geo;
|
||||
/* Old window attribute */
|
||||
XRectangle ogeo;
|
||||
/* Free window attribute */
|
||||
XRectangle free_geo;
|
||||
XRectangle geo, pgeo; /* Window geo, tiling pure geo */
|
||||
XRectangle tmp_geo, wrgeo; /* Temporary geo, without resizehint geo */
|
||||
XRectangle frame_geo; /* Frame geo */
|
||||
XRectangle ogeo; /* Old window attribute */
|
||||
XRectangle free_geo; /* Free window attribute */
|
||||
/* Tile size factors */
|
||||
int tilefact[4];
|
||||
/* For resizehint usage */
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user