I prefer doing the check in showhide
862b0d54
1 file(s) · +6 −4
| 272 | 272 | ||
| 273 | 273 | void |
|
| 274 | 274 | arrange(void) { |
|
| 275 | - | if(stack) |
|
| 276 | - | showhide(stack); |
|
| 275 | + | showhide(stack); |
|
| 277 | 276 | focus(NULL); |
|
| 278 | 277 | if(lt[sellt]->arrange) |
|
| 279 | 278 | lt[sellt]->arrange(); |
|
| 1369 | 1368 | ||
| 1370 | 1369 | void |
|
| 1371 | 1370 | showhide(Client *c) { |
|
| 1371 | + | if(!c) |
|
| 1372 | + | return; |
|
| 1372 | 1373 | if(ISVISIBLE(c)) { /* show clients top down */ |
|
| 1373 | 1374 | XMoveWindow(dpy, c->win, c->x, c->y); |
|
| 1374 | 1375 | if(!lt[sellt]->arrange || c->isfloating) |
|
| 1375 | 1376 | resize(c, c->x, c->y, c->w, c->h, True); |
|
| 1377 | + | showhide(c->snext); |
|
| 1376 | 1378 | } |
|
| 1377 | - | if(c->snext) /* hide clients bottom up */ |
|
| 1379 | + | else { /* hide clients bottom up */ |
|
| 1378 | 1380 | showhide(c->snext); |
|
| 1379 | - | if(!ISVISIBLE(c)) |
|
| 1380 | 1381 | XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); |
|
| 1382 | + | } |
|
| 1381 | 1383 | } |
|
| 1382 | 1384 | ||
| 1383 | 1385 | void |
|