dwm-autoresize-6.1.diff (1089B)
1 diff --git a/dwm.c b/dwm.c 2 index 0362114..e4e8514 100644 3 --- a/dwm.c 4 +++ b/dwm.c 5 @@ -92,7 +92,7 @@ struct Client { 6 int basew, baseh, incw, inch, maxw, maxh, minw, minh; 7 int bw, oldbw; 8 unsigned int tags; 9 - int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen; 10 + int isfixed, isfloating, isurgent, neverfocus, oldstate, isfullscreen, needresize; 11 Client *next; 12 Client *snext; 13 Monitor *mon; 14 @@ -621,6 +621,8 @@ configurerequest(XEvent *e) 15 configure(c); 16 if (ISVISIBLE(c)) 17 XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); 18 + else 19 + c->needresize = 1; 20 } else 21 configure(c); 22 } else { 23 @@ -1611,6 +1613,12 @@ showhide(Client *c) 24 if (ISVISIBLE(c)) { 25 /* show clients top down */ 26 XMoveWindow(dpy, c->win, c->x, c->y); 27 + if (c->needresize) { 28 + c->needresize = 0; 29 + XMoveResizeWindow(dpy, c->win, c->x, c->y, c->w, c->h); 30 + } else { 31 + XMoveWindow(dpy, c->win, c->x, c->y); 32 + } 33 if ((!c->mon->lt[c->mon->sellt]->arrange || c->isfloating) && !c->isfullscreen) 34 resize(c, c->x, c->y, c->w, c->h, 0); 35 showhide(c->snext);