diff options
Diffstat (limited to '')
| -rw-r--r-- | dwm.c | 28 |
1 files changed, 16 insertions, 12 deletions
| @@ -180,6 +180,7 @@ static void setclientstate(Client *c, long state); | |||
| 180 | static void setlayout(const Arg *arg); | 180 | static void setlayout(const Arg *arg); |
| 181 | static void setmfact(const Arg *arg); | 181 | static void setmfact(const Arg *arg); |
| 182 | static void setup(void); | 182 | static void setup(void); |
| 183 | static void showhide(Client *c); | ||
| 183 | static void spawn(const Arg *arg); | 184 | static void spawn(const Arg *arg); |
| 184 | static void tag(const Arg *arg); | 185 | static void tag(const Arg *arg); |
| 185 | static int textnw(const char *text, unsigned int len); | 186 | static int textnw(const char *text, unsigned int len); |
| @@ -271,18 +272,8 @@ applyrules(Client *c) { | |||
| 271 | 272 | ||
| 272 | void | 273 | void |
| 273 | arrange(void) { | 274 | arrange(void) { |
| 274 | Client *c; | 275 | if(stack) |
| 275 | 276 | showhide(stack); | |
| 276 | for(c = clients; c; c = c->next) | ||
| 277 | if(ISVISIBLE(c)) { | ||
| 278 | XMoveWindow(dpy, c->win, c->x, c->y); | ||
| 279 | if(!lt[sellt]->arrange || c->isfloating) | ||
| 280 | resize(c, c->x, c->y, c->w, c->h, True); | ||
| 281 | } | ||
| 282 | else { | ||
| 283 | XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); | ||
| 284 | } | ||
| 285 | |||
| 286 | focus(NULL); | 277 | focus(NULL); |
| 287 | if(lt[sellt]->arrange) | 278 | if(lt[sellt]->arrange) |
| 288 | lt[sellt]->arrange(); | 279 | lt[sellt]->arrange(); |
| @@ -1377,6 +1368,19 @@ setup(void) { | |||
| 1377 | } | 1368 | } |
| 1378 | 1369 | ||
| 1379 | void | 1370 | void |
| 1371 | showhide(Client *c) { | ||
| 1372 | if(ISVISIBLE(c)) { /* show clients top down */ | ||
| 1373 | XMoveWindow(dpy, c->win, c->x, c->y); | ||
| 1374 | if(!lt[sellt]->arrange || c->isfloating) | ||
| 1375 | resize(c, c->x, c->y, c->w, c->h, True); | ||
| 1376 | } | ||
| 1377 | if(c->snext) /* hide clients bottom up */ | ||
| 1378 | showhide(c->snext); | ||
| 1379 | if(!ISVISIBLE(c)) | ||
| 1380 | XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y); | ||
| 1381 | } | ||
| 1382 | |||
| 1383 | void | ||
| 1380 | spawn(const Arg *arg) { | 1384 | spawn(const Arg *arg) { |
| 1381 | /* The double-fork construct avoids zombie processes and keeps the code | 1385 | /* The double-fork construct avoids zombie processes and keeps the code |
| 1382 | * clean from stupid signal handlers. */ | 1386 | * clean from stupid signal handlers. */ |
