aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDuncaen <mail@duncano.de>2018-12-31 22:40:17 +0100
committerDuncaen <mail@duncano.de>2018-12-31 23:30:01 +0100
commit17432f37a8d5ffdc9dd31eb74ee9ab37286a089b (patch)
treee245a309d39ff3c45ed4dceb489afdf98adf2220
parent5d793210ab26932b386b2293cf58e2d6be0c86a4 (diff)
downloaddwm-17432f37a8d5ffdc9dd31eb74ee9ab37286a089b.tar.gz
hide borders if only one window is tiled
-rw-r--r--dwm.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/dwm.c b/dwm.c
index 0417378..b6ab709 100644
--- a/dwm.c
+++ b/dwm.c
@@ -1706,7 +1706,8 @@ tile(Monitor *m)
mw = m->nmaster ? m->ww * m->mfact : 0;
else
mw = m->ww;
- for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
+ for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
+ c->bw = (n > 1) ? borderpx : 0;
if (i < m->nmaster) {
h = (m->wh - my) / (MIN(n, m->nmaster) - i);
resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0, 0);
@@ -1716,6 +1717,7 @@ tile(Monitor *m)
resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0, 0);
ty += HEIGHT(c);
}
+ }
}
void
@@ -1735,9 +1737,11 @@ togglefloating(const Arg *arg)
if (selmon->sel->isfullscreen) /* no support for fullscreen windows */
return;
selmon->sel->isfloating = !selmon->sel->isfloating || selmon->sel->isfixed;
- if (selmon->sel->isfloating)
+ if (selmon->sel->isfloating) {
+ selmon->sel->bw = borderpx;
resize(selmon->sel, selmon->sel->x, selmon->sel->y,
selmon->sel->w, selmon->sel->h, 0, 0);
+ }
arrange(selmon);
drawbar(selmon);
}