autoresize patch

This commit is contained in:
Sravan Balaji
2020-11-23 20:59:34 -05:00
parent 1950543da6
commit cebe408f75
3 changed files with 45 additions and 1 deletions

10
dwm.c
View File

@@ -92,7 +92,7 @@ struct Client {
int basew, baseh, incw, inch, maxw, maxh, minw, minh;
int bw, oldbw;
unsigned int tags;
int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen;
int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen, needresize;
Client *next;
Client *snext;
Monitor *mon;
@@ -672,6 +672,8 @@ configurerequest(XEvent *e)
configure(c);
if (ISVISIBLE(c))
XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
else
c->needresize = 1;
} else
configure(c);
} else {
@@ -1760,6 +1762,12 @@ showhide(Client *c)
if (ISVISIBLE(c)) {
/* show clients top down */
XMoveWindow(dpy, c->win, c->x, c->y);
if (c->needresize) {
c->needresize = 0;
XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h);
} else {
XMoveWindow(dpy, c->win, c->x, c->y);
}
if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen)
resize(c, c->x, c->y, c->w, c->h, 0);
showhide(c->snext);