I've gone ahead and updated the bottom stack patch to work with the new
4.4 tip.  I just ported the portrait layout since that's all I use.
Please test this against the latest tip.  One question for you C
hackers, how to I get the incmaster and zoom functions with in the
tile.c to work with my new bstack.c?  Also any suggestions ore always
welcome.

Patch here: http://calminferno.net/files/dwm-4.4-bstack.diff and
attached.

-- 
James Turner
BSD Group Consulting
http://www.bsdgroup.org
--- bstack.c    Wed Dec 31 19:00:00 1969
+++ bstack.c    Sat Aug 11 14:40:27 2007
@@ -0,0 +1,56 @@
+/* See LICENSE file for copyright and license details. */
+#include "dwm.h"
+
+/* static */
+
+static double master = MASTER;
+
+/* extern */
+
+void
+bstack(void) {
+       unsigned int i, n, nx, ny, nw, nh, mw, mh, tw, th;
+       Client *c;
+
+       for(n = 0, c = nexttiled(clients); c; c = nexttiled(c->next))
+               n++;
+
+       /* window geoms */
+  mh = (n > 1) ? (wah * master) / 1 : wah / (n > 0 ? n : 1);
+  mw = waw; 
+  th = (n > 1) ? (wah * (1 - master)) / 1 : 0;
+  tw = (n > 1) ? waw / (n - 1) : 0;
+
+  for(i = 0, c = clients; c; c = c->next)
+    if(isvisible(c)) {
+      unban(c);
+      if(c->isfloating)
+        continue;
+      c->ismax = False;
+      nx = wax;
+      ny = way;  
+      if(i < 1) {
+        ny += i * mh;
+        nw = mw - 2 * c->border;
+        nh = mh - 2 * c->border;
+      }
+      else {
+        nx += (i - 1) * tw;
+        ny += mh * 1;
+        if(i + 1 == n) { /* remainder */
+          nw = (wax + waw) - nx - 2 * c->border;
+        }
+        else {
+          nw = tw - 2 * c->border;
+        }
+        nh = th - 2 * c->border + 1;
+      }
+      resize(c, nx, ny, nw, nh, False);
+      i++;
+    }
+    else
+      ban(c);
+  if(!sel || !isvisible(sel))
+    focus(NULL);
+  restack();
+}
--- bstack.h    Wed Dec 31 19:00:00 1969
+++ bstack.h    Sat Aug 11 13:30:37 2007
@@ -0,0 +1,4 @@
+/* See LICENSE file for copyright and license details. */
+
+/* bstack.c */
+void bstack(void);                     /* arranges all windows bottom stacked 
*/
--- config.arg.h        Sat Aug 11 11:38:26 2007
+++ config.arg.h        Sat Aug 11 12:00:41 2007
@@ -26,11 +26,13 @@ static Rule rule[] = { \
 /* layout(s) */
 #include "tile.h"
 #include "float.h"
+#include "bstack.h"
 #define LAYOUTS \
 static Layout layout[] = { \
        /* symbol               function */ \
        { "[]=",                tile }, /* first entry is default */ \
        { "><>",                floating }, \
+  { "TTT",    bstack }, \
 };
 #define MASTER                 0.6     /* 0.1 .. 0.9 */
 #define SNAP                   32      /* snap pixel */
--- config.default.h    Sat Aug 11 11:38:26 2007
+++ config.default.h    Sat Aug 11 12:00:19 2007
@@ -27,11 +27,13 @@ static Rule rule[] = { \
 /* layout(s) */
 #include "tile.h"
 #include "float.h"
+#include "bstack.h"
 #define LAYOUTS \
 static Layout layout[] = { \
        /* symbol               function */ \
        { "[]=",                tile }, /* first entry is default */ \
        { "><>",                floating }, \
+  { "TTT",    bstack }, \
 };
 #define MASTER                 0.6     /* 0.1 .. 0.9 */
 #define SNAP                   32      /* snap pixel */
--- config.mk   Sat Aug 11 11:38:26 2007
+++ config.mk   Sat Aug 11 11:59:46 2007
@@ -4,7 +4,7 @@ VERSION = 4.4
 # Customize below to fit your system
 
 # layouts
-SRC = float.c tile.c
+SRC = float.c tile.c bstack.c
 
 # paths
 PREFIX = /usr/local

Reply via email to