--- bstack.c Wed Dec 31 19:00:00 1969 +++ bstack.c Wed Oct 24 22:28:48 2007 @@ -0,0 +1,41 @@ +void +bstack(void) { + unsigned int i, n, nx, ny, nw, nh, mh, tw, th; + Client *c, *mc; + + for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) + n++; + + /* window geoms */ + mh = (n == 1) ? wah : mwfact * wah; + tw = (n > 1) ? waw / (n - 1) : 0; + th = (n > 1) ? (1 - mwfact) * wah : 0; + + nx = wax; + ny = way; + nh = 0; /* gcc stupidity required this */ + for(i = 0, c = mc = nexttiled(clients); c; c = nexttiled(c->next), i++) { + c->ismax = False; + if(i == 0) { /* master */ + nw = waw - 2 * c->border; + nh = mh - 2 * c->border; + } + else { /* tile window */ + if(i == 1) { + nx = wax; + ny += mc->h + 2 * mc->border; + nh = th - 2 * c->border; + } + if(i + 1 == n) /* remainder */ + nw = (wax + waw) - nx - 2 * c->border; + else + nw = tw - 2 * c->border; + } + resize(c, nx, ny, nw, nh, True); + if((c->h < bh) || (c->h > nh) || (c->w < bh) || (c->w > nw)) + /* client doesn't accept geometry, so enforce it */ + resize(c, nx, ny, nw, nh, False); + if(n > 1 && tw != waw) + nx = c->x + c->w + 2 * c->border; + } +} --- config.def.h Wed Oct 24 22:04:30 2007 +++ config.def.h Wed Oct 24 22:10:17 2007 @@ -22,13 +22,15 @@ Rule rules[] = { }; /* layout(s) */ -#define ISTILE isarrange(tile) /* || isarrange() */ +#define ISTILE isarrange(tile) || isarrange(bstack) /* || isarrange() */ #define MWFACT 0.6 /* master width factor [0.1 .. 0.9] */ #define SNAP 32 /* snap pixel */ +#include "bstack.c" Layout layouts[] = { /* symbol function */ { "[]=", tile }, /* first entry is default */ { "><>", floating }, + { "TTT", bstack }, }; /* key definitions */