Sfoglia il codice sorgente

I prefer doing the check in showhide

Anselm R Garbe 17 anni fa
parent
commit
862b0d541d
1 ha cambiato i file con 6 aggiunte e 4 eliminazioni
  1. 6 4
      dwm.c

+ 6 - 4
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