summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorAnselm R Garbe <garbeam@gmail.com>2008-09-06 09:21:32 +0100
committerAnselm R Garbe <garbeam@gmail.com>2008-09-06 09:21:32 +0100
commitc1c6fdc5d8fef1247ac28e08ecc4d883095d1666 (patch)
treebb867fd15e35a7050a55f42e15c748188f296744
parentapplied Martin Hurton's checkotherwm simplification (diff)
downloaddwm-c1c6fdc5d8fef1247ac28e08ecc4d883095d1666.tar.gz
dwm-c1c6fdc5d8fef1247ac28e08ecc4d883095d1666.zip
applied Donald Chai's showhide patch in slightly modified ways
Diffstat (limited to '')
-rw-r--r--dwm.c28
1 files changed, 16 insertions, 12 deletions
diff --git a/dwm.c b/dwm.c
index e7804dc..50bbd6a 100644
--- a/dwm.c
+++ b/dwm.c
@@ -180,6 +180,7 @@ static void setclientstate(Client *c, long state);
180static void setlayout(const Arg *arg); 180static void setlayout(const Arg *arg);
181static void setmfact(const Arg *arg); 181static void setmfact(const Arg *arg);
182static void setup(void); 182static void setup(void);
183static void showhide(Client *c);
183static void spawn(const Arg *arg); 184static void spawn(const Arg *arg);
184static void tag(const Arg *arg); 185static void tag(const Arg *arg);
185static int textnw(const char *text, unsigned int len); 186static int textnw(const char *text, unsigned int len);
@@ -271,18 +272,8 @@ applyrules(Client *c) {
271 272
272void 273void
273arrange(void) { 274arrange(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
1379void 1370void
1371showhide(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
1383void
1380spawn(const Arg *arg) { 1384spawn(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. */