*w -= *w % c->incw;
if(c->inch)
*h -= *h % c->inch;
+
/* restore base dimensions */
*w = MAX(*w + c->basew, c->minw);
*h = MAX(*h + c->baseh, c->minh);
+
if(c->maxw)
*w = MIN(*w, c->maxw);
if(c->maxh)
c->oldw = c->w; c->w = wc.width = w;
c->oldh = c->h; c->h = wc.height = h;
wc.border_width = c->bw;
+
XConfigureWindow(dpy, c->win, CWX|CWY|CWWidth|CWHeight|CWBorderWidth, &wc);
configure(c);
XSync(dpy, False);
static void bookshelf(Monitor *m)
{
int n, w, x;
+ int extraw;
+
Client *c;
/* count the clients on this monitor */
w = m->ww / n;
x = m->wx;
+ /* make the first window a bit larger if the width can't be divided evenly */
+ extraw = m->ww - (w * n);
+
/* assign positions and sizes to all clients on this screen */
for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) {
- resize(c, x, m->wy, w - 2 * c->bw, m->wh - 2 * c->bw, False);
+ c->incw = 0;
+ c->inch = 0;
+
+ resize(c, x, m->wy, w + extraw - 2 * c->bw, m->wh - 2 * c->bw, False);
/*
* Since all clients are horizontally aligned and the
* same size, only the x coordinate changes.
*/
x += WIDTH(c);
+ extraw = 0;
}
return;
static void bookstack(Monitor *m)
{
int n, h, y;
+ int extrah;
+
Client *c;
/*
h = m->wh / n;
y = m->wy;
+ extrah = m->wh - (h * n);
for(c = nexttiled(m->clients); c; c = nexttiled(c->next)) {
- resize(c, m->wx, y, m->ww - 2 * c->bw, h - 2 * c->bw, False);
+ c->incw = 0;
+ c->inch = 0;
+
+ resize(c, m->wx, y, m->ww - 2 * c->bw, h + extrah - 2 * c->bw, False);
y += HEIGHT(c);
+ extrah = 0;
}
return;