summaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--dwm.c24
1 files changed, 12 insertions, 12 deletions
diff --git a/dwm.c b/dwm.c
index 5138752..8dc88fe 100644
--- a/dwm.c
+++ b/dwm.c
@@ -156,7 +156,7 @@ void manage(Window w, XWindowAttributes *wa);
156void mappingnotify(XEvent *e); 156void mappingnotify(XEvent *e);
157void maprequest(XEvent *e); 157void maprequest(XEvent *e);
158void movemouse(Client *c); 158void movemouse(Client *c);
159Client *nextunfloating(Client *c); 159Client *nexttiled(Client *c);
160void propertynotify(XEvent *e); 160void propertynotify(XEvent *e);
161void quit(const void *arg); 161void quit(const void *arg);
162void resize(Client *c, int x, int y, int w, int h, Bool sizehints); 162void resize(Client *c, int x, int y, int w, int h, Bool sizehints);
@@ -1051,7 +1051,7 @@ movemouse(Client *c) {
1051} 1051}
1052 1052
1053Client * 1053Client *
1054nextunfloating(Client *c) { 1054nexttiled(Client *c) {
1055 for(; c && (c->isfloating || !isvisible(c)); c = c->next); 1055 for(; c && (c->isfloating || !isvisible(c)); c = c->next);
1056 return c; 1056 return c;
1057} 1057}
@@ -1464,12 +1464,12 @@ tile(void) {
1464 uint i, n; 1464 uint i, n;
1465 Client *c; 1465 Client *c;
1466 1466
1467 for(n = 0, c = nextunfloating(clients); c; c = nextunfloating(c->next), n++); 1467 for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next), n++);
1468 if(n == 0) 1468 if(n == 0)
1469 return; 1469 return;
1470 1470
1471 /* master */ 1471 /* master */
1472 c = nextunfloating(clients); 1472 c = nexttiled(clients);
1473 1473
1474 if(n == 1) 1474 if(n == 1)
1475 tileresize(c, wx, wy, ww - 2 * c->bw, wh - 2 * c->bw); 1475 tileresize(c, wx, wy, ww - 2 * c->bw, wh - 2 * c->bw);
@@ -1487,7 +1487,7 @@ tile(void) {
1487 if(h < bh) 1487 if(h < bh)
1488 h = th; 1488 h = th;
1489 1489
1490 for(i = 0, c = nextunfloating(c->next); c; c = nextunfloating(c->next), i++) { 1490 for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) {
1491 if(i + 1 == n) /* remainder */ 1491 if(i + 1 == n) /* remainder */
1492 tileresize(c, x, y, w - 2 * c->bw, (ty + th) - y - 2 * c->bw); 1492 tileresize(c, x, y, w - 2 * c->bw, (ty + th) - y - 2 * c->bw);
1493 else 1493 else
@@ -1789,14 +1789,14 @@ void
1789zoom(const void *arg) { 1789zoom(const void *arg) {
1790 Client *c = sel; 1790 Client *c = sel;
1791 1791
1792 if(c == nextunfloating(clients)) 1792 if(!lt->arrange || sel->isfloating)
1793 if(!c || !(c = nextunfloating(c->next))) 1793 return;
1794 if(c == nexttiled(clients))
1795 if(!c || !(c = nexttiled(c->next)))
1794 return; 1796 return;
1795 if(lt->arrange == tile && !sel->isfloating) { 1797 detach(c);
1796 detach(c); 1798 attach(c);
1797 attach(c); 1799 focus(c);
1798 focus(c);
1799 }
1800 arrange(); 1800 arrange();
1801} 1801}
1802 1802