--- dwm.c | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/dwm.c b/dwm.c index a5ce993..b55d9c6 100644 --- a/dwm.c +++ b/dwm.c _AT_@ -968,7 +968,15 @@ grabkeys(void) void incnmaster(const Arg *arg) { - selmon->nmaster = MAX(selmon->nmaster + arg->i, 0); + int n; + Client* c; + + if (arg->i > 0) { + for (n = 0, c = nexttiled(selmon->clients); c; c = nexttiled(c->next), n++); + selmon->nmaster = MIN(n, selmon->nmaster + arg->i); + } + else + selmon->nmaster = MAX(selmon->nmaster + arg->i, 0); arrange(selmon); } -- 2.13.0Received on Thu Jun 01 2017 - 23:38:17 CEST
This archive was generated by hypermail 2.3.0 : Thu Jun 01 2017 - 23:48:23 CEST