summaryrefslogtreecommitdiffstats
path: root/view.c
diff options
context:
space:
mode:
authorAnselm R. Garbe <arg@suckless.org>2007-01-11 13:43:38 +0100
committerAnselm R. Garbe <arg@suckless.org>2007-01-11 13:43:38 +0100
commitd108cfa7fc47000af49e70a49e865b9eb236c57d (patch)
treec617d1917d46a58c78d970cd8144a382a6bec44f /view.c
parentadded Button{4,5} description to dwm.1 (diff)
downloaddwm-d108cfa7fc47000af49e70a49e865b9eb236c57d.tar.gz
dwm-d108cfa7fc47000af49e70a49e865b9eb236c57d.zip
allowing nmaster=0 (I think that's a straight idea)
Diffstat (limited to '')
-rw-r--r--view.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/view.c b/view.c
index 06aed3e..4513a45 100644
--- a/view.c
+++ b/view.c
@@ -75,11 +75,16 @@ dotile(void) {
75 75
76 for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) 76 for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
77 n++; 77 n++;
78
78 /* window geoms */ 79 /* window geoms */
79 mw = (n > nmaster) ? (waw * master) / 1000 : waw; 80 if(nmaster > 0) {
80 mh = (n > nmaster) ? wah / nmaster : wah / (n > 0 ? n : 1); 81 mh = (n > nmaster) ? wah / nmaster : wah / (n > 0 ? n : 1);
81 tw = waw - mw; 82 mw = (n > nmaster) ? (waw * master) / 1000 : waw;
83 }
84 else
85 mh = mw = 0;
82 th = (n > nmaster) ? wah / (n - nmaster) : 0; 86 th = (n > nmaster) ? wah / (n - nmaster) : 0;
87 tw = waw - mw;
83 88
84 for(i = 0, c = clients; c; c = c->next) 89 for(i = 0, c = clients; c; c = c->next)
85 if(isvisible(c)) { 90 if(isvisible(c)) {
@@ -90,7 +95,7 @@ dotile(void) {
90 c->ismax = False; 95 c->ismax = False;
91 c->x = wax; 96 c->x = wax;
92 c->y = way; 97 c->y = way;
93 if(i < nmaster) { 98 if((nmaster > 0) && (i < nmaster)) {
94 c->y += i * mh; 99 c->y += i * mh;
95 c->w = mw - 2 * BORDERPX; 100 c->w = mw - 2 * BORDERPX;
96 c->h = mh - 2 * BORDERPX; 101 c->h = mh - 2 * BORDERPX;
@@ -150,7 +155,9 @@ focusprev(Arg *arg) {
150 155
151void 156void
152incnmaster(Arg *arg) { 157incnmaster(Arg *arg) {
153 if((arrange == dofloat) || (nmaster + arg->i < 1) || (wah / (nmaster + arg->i) < bh)) 158 if((arrange == dofloat)
159 || ((int)nmaster + arg->i < 0)
160 || (((int)nmaster + arg->i > 0) && (wah / (nmaster + arg->i) < bh)))
154 return; 161 return;
155 nmaster += arg->i; 162 nmaster += arg->i;
156 updatemodetext(); 163 updatemodetext();