--- bstack.c Wed Dec 31 19:00:00 1969 +++ bstack.c Fri Nov 2 18:34:32 2007 @@ -0,0 +1,40 @@ +void +bstack(void) { + unsigned int i, n, nx, ny, nw, nh, mh, tw, th; + Client *c, *mc; + + domwfact = dozoom = True; + for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next)) + n++; + + 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; + for(i = 0, c = mc = nexttiled(clients); c; c = nexttiled(c->next), i++) { + c->ismax = False; + if(i == 0) { + nw = waw - 2 * c->border; + nh = mh - 2 * c->border; + } + else { + if(i == 1) { + nx = wax; + ny += mc->h + 2 * mc->border; + nh = th - 2 * c->border; + } + if(i + 1 == n) + nw = (wax + waw) - nx - 2 * c->border; + else + nw = tw - 2 * c->border; + } + resize(c, nx, ny, nw, nh, RESIZEHINTS); + if((RESIZEHINTS) && ((c->h < bh) || (c->h > nh) || (c->w < bh) || (c->w > nw))) + resize(c, nx, ny, nw, nh, False); + if(n > 1 && tw != waw) + nx = c->x + c->w + 2 * c->border; + } +} --- config.def.h Fri Nov 2 18:31:44 2007 +++ config.def.h Fri Nov 2 18:32:53 2007 @@ -30,10 +30,12 @@ Rule rules[] = { #define MWFACT 0.6 /* master width factor [0.1 .. 0.9] */ #define RESIZEHINTS True /* False - respect size hints in tiled resizals */ #define SNAP 32 /* snap pixel */ +#include "bstack.c" Layout layouts[] = { /* symbol function */ { "[]=", tile }, /* first entry is default */ { "><>", floating }, + { "TTT", bstack }, }; /* key definitions */