static int nmaster = NMASTER; static void setnmaster(const Arg *arg) { int n; if(arg->i) { n = nmaster + arg->i; if(n < 1 || wh / n <= 2 * borderpx) return; nmaster = n; } else nmaster = NMASTER; arrange(); } static Client * ntilecol(Client* c, uint n, int x, int y, int w, int h) { uint i, d; for(i = 0; c && i < n; c = nexttiled(c->next), ++i) { resize(c, x, y, w - 2 * c->bw, h / (n - i) - 2 * c->bw, True); d = c->h + 2 * c->bw; y += d; h -= d; } return c; } static void ntile(void) { Client *c; uint n, mw; for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next), ++n); c = nexttiled(clients); if(n <= nmaster) ntilecol(c, n, wx, wy, ww, wh); else { mw = mfact * ww; ntilecol(ntilecol(c, nmaster, wx, wy, mw, wh), n - nmaster, wx + mw, wy, ww - mw, wh); } }