void bstack(void) { unsigned int i, n, nx, ny, nw, nh, mh; Client *c; for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) n++; /* window geoms */ mh = (n > 1) ? (wah * mwfact) / 1 : wah / (n > 0 ? n : 1); if (c = nexttiled(clients)) resize(c, wax, way, waw - 2 * c->border, mh - 2 * c->border, RESIZEHINTS); if (n > 1) { ny = c->y + c->h + 2 * c->border; nw = waw / (n - 1); nh = wah - c->h - 2 * c->border; nx = wax; for(i = 1, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) { c->ismax = False; if(i + 1 == n) /* remainder */ nw = (wax + waw) - nx - 2 * c->border; resize(c, nx, ny, nw, nh, RESIZEHINTS); nx = c->x + c->w + 2 * c->border; } } }