Fixed some layout bugs from 4.6 and 4.7. Should perform even better
with resizehints.
http://bsdgroup.org/files/dwm-4.7-bstack.diff
--
James Turner
BSD Group Consulting
http://www.bsdgroup.org
--- bstack.c Wed Dec 31 19:00:00 1969
+++ bstack.c Fri Nov 2 19:22:07 2007
@@ -0,0 +1,39 @@
+void
+bstack(void) {
+ unsigned int i, n, nx, ny, nw, nh, mh, tw;
+ 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;
+
+ 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) {
+ nh = mh - 2 * c->border;
+ nw = waw - 2 * c->border;
+ }
+ else {
+ if(i == 1) {
+ nx = wax;
+ ny += mc->h + 2 * mc->border;
+ nh = (way + wah) - ny - 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 19:21:54 2007
+++ config.def.h Fri Nov 2 19:22:15 2007
@@ -30,10 +30,12 @@
#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 */