- for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
- n++;
- /* window geoms */
- mh = (n > nmaster) ? wah / nmaster : wah / (n > 0 ? n : 1);
- mw = (n > nmaster) ? (waw * masterw) / 1000 : waw;
- th = (n > nmaster) ? wah / (n - nmaster) : 0;
- tw = waw - mw;
-
- for(i = 0, c = clients; c; c = c->next)
- if(isvisible(c)) {
- unban(c);
- if(c->isfloating)
- continue;
- c->ismax = False;
- nx = wax;
- ny = way;
- if(i < nmaster) {
- ny += i * mh;
- nw = mw - 2 * c->border;
- nh = mh;
- if(i + 1 == (n < nmaster ? n : nmaster)) /* remainder */
- nh = wah - mh * i;
- nh -= 2 * c->border;
- }
- else { /* tile window */
- nx += mw;
- nw = tw - 2 * c->border;
- if(th > 2 * c->border) {
- ny += (i - nmaster) * th;
- nh = th;
- if(i + 1 == n) /* remainder */
- nh = wah - th * (i - nmaster);
- nh -= 2 * c->border;
- }
- else /* fallback if th <= 2 * c->border */
- nh = wah - 2 * c->border;
- }
- resize(c, nx, ny, nw, nh, False);
- i++;
- }
- else
- ban(c);
- focus(NULL);
- restack();
+ for(c = clients; c; c = c->next)
+ if(isvisible(c))
+ resize(c, c->x, c->y, c->w, c->h, True);