1 /* See LICENSE file for copyright and license details. */
2 int bx, by, bw, bh, blw, mx, my, mw, mh, tx, ty, tw, th, wx, wy, ww, wh;
4 void setmfact(const char *arg);
6 void tileresize(Client *c, int x, int y, int w, int h);
7 void updatetilegeom(void);
10 setmfact(const char *arg) {
13 if(!arg || lt->arrange != tile)
16 d = strtod(arg, NULL);
17 if(arg[0] == '-' || arg[0] == '+')
19 if(d < 0.1 || d > 0.9)
33 for(n = 0, c = nextunfloating(clients); c; c = nextunfloating(c->next), n++);
38 c = nextunfloating(clients);
41 tileresize(c, wx, wy, ww - 2 * c->bw, wh - 2 * c->bw);
43 tileresize(c, mx, my, mw - 2 * c->bw, mh - 2 * c->bw);
49 x = (tx > c->x + c->w) ? c->x + c->w + 2 * c->bw : tw;
51 w = (tx > c->x + c->w) ? wx + ww - x : tw;
56 for(i = 0, c = nextunfloating(c->next); c; c = nextunfloating(c->next), i++) {
57 if(i + 1 == n) /* remainder */
58 tileresize(c, x, y, w - 2 * c->bw, (ty + th) - y - 2 * c->bw);
60 tileresize(c, x, y, w - 2 * c->bw, h - 2 * c->bw);
62 y = c->y + c->h + 2 * c->bw;
67 tileresize(Client *c, int x, int y, int w, int h) {
68 resize(c, x, y, w, h, resizehints);
69 if(resizehints && ((c->h < bh) || (c->h > h) || (c->w < bh) || (c->w > w)))
70 /* client doesn't accept size constraints */
71 resize(c, x, y, w, h, False);
75 zoom(const char *arg) {
78 if(c == nextunfloating(clients))
79 if(!c || !(c = nextunfloating(c->next)))
81 if(lt->arrange == tile && !sel->isfloating) {
90 updatetilegeom(void) {
91 /* master area geometry */
97 /* tile area geometry */