1 /* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
2 * See LICENSE file for license details.
15 if((c->ismax = !c->ismax)) {
20 resize(c, wax, way, waw - 2 * BORDERPX, wah - 2 * BORDERPX, True);
23 resize(c, c->rx, c->ry, c->rw, c->rh, True);
24 while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
31 unsigned int i, n, nx, ny, nw, nh, mw, mh, tw, th;
34 for(n = 0, c = nextmanaged(clients); c; c = nextmanaged(c->next))
37 mh = (n > nmaster) ? wah / nmaster : wah / (n > 0 ? n : 1);
38 mw = (n > nmaster) ? (waw * master) / 1000 : waw;
39 th = (n > nmaster) ? wah / (n - nmaster) : 0;
42 for(i = 0, c = clients; c; c = c->next)
45 XMoveWindow(dpy, c->win, c->x, c->y);
54 nw = mw - 2 * BORDERPX;
55 nh = mh - 2 * BORDERPX;
57 else { /* tile window */
59 nw = tw - 2 * BORDERPX;
60 if(th > 2 * BORDERPX) {
61 ny += (i - nmaster) * th;
62 nh = th - 2 * BORDERPX;
64 else /* fallback if th <= 2 * BORDERPX */
65 nh = wah - 2 * BORDERPX;
67 resize(c, nx, ny, nw, nh, False);
72 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
74 if(!sel || !isvisible(sel)) {
75 for(c = stack; c && !isvisible(c); c = c->snext);
82 incnmaster(Arg *arg) {
83 if((arrange == dofloat) || (nmaster + arg->i < 1)
84 || (wah / (nmaster + arg->i) <= 2 * BORDERPX))
94 resizemaster(Arg *arg) {
100 if(waw * (master + arg->i) / 1000 >= waw - 2 * BORDERPX
101 || waw * (master + arg->i) / 1000 <= 2 * BORDERPX)
115 if(sel->isfloat || (arrange == dofloat)) {
119 for(n = 0, c = nextmanaged(clients); c; c = nextmanaged(c->next))
122 if((c = sel) == nextmanaged(clients))
123 if(!(c = nextmanaged(c->next)))