X-Git-Url: https://jasonwoof.com/gitweb/?a=blobdiff_plain;f=dwm.c;h=dd39fe10e18d4a5982a3508ba3b307c623d23afe;hb=83abfc05eb5a1e6ee762ce2921d9d5270e40c9ee;hp=50bbd6a0f98f04ec3e7696fb87a30b7b2f428582;hpb=c1c6fdc5d8fef1247ac28e08ecc4d883095d1666;p=dwm.git diff --git a/dwm.c b/dwm.c index 50bbd6a..dd39fe1 100644 --- a/dwm.c +++ b/dwm.c @@ -272,8 +272,7 @@ applyrules(Client *c) { void arrange(void) { - if(stack) - showhide(stack); + showhide(stack); focus(NULL); if(lt[sellt]->arrange) lt[sellt]->arrange(); @@ -1369,15 +1368,18 @@ setup(void) { void showhide(Client *c) { + if(!c) + return; if(ISVISIBLE(c)) { /* show clients top down */ XMoveWindow(dpy, c->win, c->x, c->y); if(!lt[sellt]->arrange || c->isfloating) resize(c, c->x, c->y, c->w, c->h, True); + showhide(c->snext); } - if(c->snext) /* hide clients bottom up */ + else { /* hide clients bottom up */ showhide(c->snext); - if(!ISVISIBLE(c)) XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); + } } void @@ -1588,7 +1590,9 @@ updatesizehints(Client *c) { long msize; XSizeHints size; - XGetWMNormalHints(dpy, c->win, &size, &msize); + if(!XGetWMNormalHints(dpy, c->win, &size, &msize)) + /* size is uninitialized, ensure that size.flags aren't used */ + size.flags = PSize; if(size.flags & PBaseSize) { c->basew = size.base_width; c->baseh = size.base_height;