1 /* (C)opyright MMVI-MMVII Anselm R. Garbe <garbeam at gmail dot com>
2 * See LICENSE file for license details.
6 unsigned int master = MASTER;
7 unsigned int nmaster = NMASTER;
12 togglemax(Client *c) {
17 if((c->ismax = !c->ismax)) {
22 resize(c, wax, way, waw - 2 * BORDERPX, wah - 2 * BORDERPX, True);
25 resize(c, c->rx, c->ry, c->rw, c->rh, True);
26 while(XCheckMaskEvent(dpy, EnterWindowMask, &ev));
33 unsigned int i, n, nx, ny, nw, nh, mw, mh, tw, th;
36 for(n = 0, c = nextmanaged(clients); c; c = nextmanaged(c->next))
39 mh = (n > nmaster) ? wah / nmaster : wah / (n > 0 ? n : 1);
40 mw = (n > nmaster) ? (waw * master) / 1000 : waw;
41 th = (n > nmaster) ? wah / (n - nmaster) : 0;
44 for(i = 0, c = clients; c; c = c->next)
47 XMoveWindow(dpy, c->win, c->x, c->y);
56 nw = mw - 2 * BORDERPX;
57 nh = mh - 2 * BORDERPX;
59 else { /* tile window */
61 nw = tw - 2 * BORDERPX;
62 if(th > 2 * BORDERPX) {
63 ny += (i - nmaster) * th;
64 nh = th - 2 * BORDERPX;
66 else /* fallback if th <= 2 * BORDERPX */
67 nh = wah - 2 * BORDERPX;
69 resize(c, nx, ny, nw, nh, False);
74 XMoveWindow(dpy, c->win, c->x + 2 * sw, c->y);
76 if(!sel || !isvisible(sel)) {
77 for(c = stack; c && !isvisible(c); c = c->snext);
84 incnmaster(Arg *arg) {
85 if((arrange == dofloat) || (nmaster + arg->i < 1)
86 || (wah / (nmaster + arg->i) <= 2 * BORDERPX))
96 resizemaster(Arg *arg) {
102 if(waw * (master + arg->i) / 1000 >= waw - 2 * BORDERPX
103 || waw * (master + arg->i) / 1000 <= 2 * BORDERPX)
117 if(sel->isfloat || (arrange == dofloat)) {
121 for(n = 0, c = nextmanaged(clients); c; c = nextmanaged(c->next))
124 if((c = sel) == nextmanaged(clients))
125 if(!(c = nextmanaged(c->next)))