void tag(const void *arg);
uint textnw(const char *text, uint len);
void tile(void);
-void tileresize(Client *c, int x, int y, int w, int h);
void togglebar(const void *arg);
void togglefloating(const void *arg);
void togglelayout(const void *arg);
[UnmapNotify] = unmapnotify
};
Atom wmatom[WMLast], netatom[NetLast];
-Bool domax = False;
+Bool ismax = False;
Bool otherwm, readin;
Bool running = True;
uint tagset[] = {1, 1}; /* after start, first tag is selected */
}
focus(NULL);
- if(lt->arrange && !domax)
+ if(lt->arrange && !ismax)
lt->arrange();
restack();
}
}
else if((c = getclient(ev->window))) {
focus(c);
- if(CLEANMASK(ev->state) != MODKEY || domax)
+ if(CLEANMASK(ev->state) != MODKEY || ismax)
return;
if(ev->button == Button1)
movemouse(c);
}
if(blw > 0) {
dc.w = blw;
- drawtext(lt->symbol, dc.norm, domax);
+ drawtext(lt->symbol, dc.norm, ismax);
x = dc.x + dc.w;
}
else
}
sel = c;
if(c) {
- if(domax) {
+ if(ismax) {
XMoveResizeWindow(dpy, c->win, wx, wy, ww - 2 * c->bw, wh - 2 * c->bw);
c->ismax = True;
}
x = sx;
if(y + h + 2 * c->bw < sy)
y = sy;
+ if(h < bh)
+ h = bh;
+ if(w < bh)
+ w = bh;
if(c->x != x || c->y != y || c->w != w || c->h != h || c->isbanned || c->ismax) {
c->isbanned = c->ismax = False;
c->x = wc.x = x;
drawbar();
if(!sel)
return;
- if(domax || sel->isfloating || !lt->arrange)
+ if(ismax || sel->isfloating || !lt->arrange)
XRaiseWindow(dpy, sel->win);
- if(!domax && lt->arrange) {
+ if(!ismax && lt->arrange) {
wc.stack_mode = Below;
wc.sibling = barwin;
for(c = stack; c; c = c->snext)
void
tile(void) {
- int x, y, h, w, mx, my, mw, mh, tx, ty, tw, th;
+ int x, y, h, w, mw;
uint i, n;
Client *c;
if(n == 0)
return;
- /* master area geometry */
- mx = wx;
- my = wy;
- mw = mfact * ww;
- mh = wh;
-
- /* tile area geometry */
- tx = mx + mw;
- ty = wy;
- tw = ww - mw;
- th = wh;
-
/* master */
c = nexttiled(clients);
-
- if(n == 1)
- tileresize(c, wx, wy, ww - 2 * c->bw, wh - 2 * c->bw);
- else
- tileresize(c, mx, my, mw - 2 * c->bw, mh - 2 * c->bw);
+ mw = mfact * ww;
+ resize(c, wx, wy, ((n == 1) ? ww : mw) - 2 * c->bw, wh - 2 * c->bw, resizehints);
if(--n == 0)
return;
/* tile stack */
- x = (tx > c->x + c->w) ? c->x + c->w + 2 * c->bw : tw;
- y = ty;
- w = (tx > c->x + c->w) ? wx + ww - x : tw;
- h = th / n;
+ x = (wx + mw > c->x + c->w) ? c->x + c->w + 2 * c->bw : ww - mw;
+ y = wy;
+ w = (wx + mw > c->x + c->w) ? wx + ww - x : ww - mw;
+ h = wh / n;
if(h < bh)
- h = th;
+ h = wh;
for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) {
- if(i + 1 == n) /* remainder */
- tileresize(c, x, y, w - 2 * c->bw, (ty + th) - y - 2 * c->bw);
- else
- tileresize(c, x, y, w - 2 * c->bw, h - 2 * c->bw);
- if(h != th)
+ resize(c, x, y, w - 2 * c->bw, /* remainder */ ((i + 1 == n)
+ ? (wy + wh) - y : h) - 2 * c->bw, resizehints);
+ if(h != wh)
y = c->y + c->h + 2 * c->bw;
}
}
-void
-tileresize(Client *c, int x, int y, int w, int h) {
- resize(c, x, y, w, h, resizehints);
- if(resizehints && ((c->h < bh) || (c->h > h) || (c->w < bh) || (c->w > w)))
- /* client doesn't accept size constraints */
- resize(c, x, y, w, h, False);
-}
-
void
togglebar(const void *arg) {
showbar = !showbar;
void
togglemax(const void *arg) {
- domax = !domax;
+ ismax = !ismax;
arrange();
}