On Sat, May 31, 2008 at 12:16:24PM -0400, James Turner wrote:
> On Sat, May 31, 2008 at 06:06:34PM +0200, Anselm R. Garbe wrote:
> > On Fri, May 30, 2008 at 07:48:09PM -0400, James Turner wrote:
> > > Is the lt->arrange behavior in setmfact going to get changed before 5.0
> > > is released so we don't need to basically recreate the function in our
> > > layout patches?
> > 
> > Yes I changed it, see hg tip.
> > 
> > Kind regards,
> > -- 
> >  Anselm R. Garbe >< http://www.suckless.org/ >< GPG key: 0D73F361
> 
> Thanks for updating hg, however, after pulling the latest changes and
> removing my bsetmfact function, I am still unable to resize the master
> area with modkey+h and modkey+l, am I still missing something? Thanks.
> 
> -- 
> James Turner
> BSD Group Consulting
> http://www.bsdgroup.org

I think it should be if(!d || !lt->arrange) not if(!d || lt->arrange)?
If that is the case, then attached is an updated bstack patch without
the bsetmfact function.  Also available here [0].

[0] http://bsdgroup.org/files/dwm-5.0-bstack.diff

-- 
James Turner
BSD Group Consulting
http://www.bsdgroup.org
--- bstack.c    Wed Dec 31 19:00:00 1969
+++ bstack.c    Sat May 31 12:11:38 2008
@@ -0,0 +1,33 @@
+void
+bstack(void) {
+       int x, y, h, w, mh;
+       uint i, n;
+       Client *c;
+
+       for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next), n++);
+       if(n == 0)
+               return;
+
+       /* master */
+       c = nexttiled(clients);
+       mh = mfact * wh;
+       resize(c, wx, wy, ww - 2 * c->bw, ((n == 1) ? wh : mh) - 2 * c->bw, 
resizehints);
+
+       if(--n == 0)
+               return;
+
+       /* tile stack */
+       x = wx;
+       y = (wy + mh > c->y + c->h) ? c->y + c->h + 2 * c->bw : wh - mh;
+       w = ww / n;
+       h = (wy + mh > c->y + c->h) ? wy + wh - y : wh - mh;
+       if(h < bh)
+               h = wh;
+
+       for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) {
+               resize(c, x, y, /* remainder */ ((i + 1 == n) ? (wx + ww) - x
+                      : w) - 2 * c->bw, h - 2 * c->bw, resizehints);
+               if(w != ww)
+                       x = c->x + c->w + 2 * c->bw;    
+       }
+}
--- config.def.h        Sat May 31 12:10:31 2008
+++ config.def.h        Sat May 31 12:11:52 2008
@@ -26,10 +26,13 @@ Rule rules[] = {
 double mfact           = 0.55;
 Bool resizehints       = True;     /* False means respect size hints in tiled 
resizals */
 
+#include "bstack.c"
+
 Layout layouts[] = {
        /* symbol     arrange function */
        { "[]=",      tile }, /* first entry is default */
        { "><>",      NULL }, /* no layout function means floating behavior */
+       { "TTT",      bstack },
 };
 
 /* key definitions */

Reply via email to