Replaced 'tile' layout with 'flextile' layout.
authorAaron Taylor <ataylor@subgeniuskitty.com>
Sat, 4 Feb 2023 00:05:45 +0000 (16:05 -0800)
committerAaron Taylor <ataylor@subgeniuskitty.com>
Sat, 4 Feb 2023 00:05:45 +0000 (16:05 -0800)
https://dwm.suckless.org/patches/flextile/

README
config.def.h
config.h
dwm.c
flextile.h [new file with mode: 0644]

diff --git a/README b/README
index fc3c58b..efee3ef 100644 (file)
--- a/README
+++ b/README
@@ -2,6 +2,9 @@ This git repository contains my personal branch of dwm-6.4.
 
 The changes made to stock dwm add the following abilities.
 
 
 The changes made to stock dwm add the following abilities.
 
+  - Replaced stock 'tile' layout with 'flextile'.
+    <https://dwm.suckless.org/patches/flextile/>
+
   - Added new layout with three columns, master in the middle.
     <https://dwm.suckless.org/patches/three-column/>
 
   - Added new layout with three columns, master in the middle.
     <https://dwm.suckless.org/patches/three-column/>
 
index 12bbb42..a7b73a1 100644 (file)
@@ -23,6 +23,9 @@ static const char *colors[][3]      = {
 #define MAX_TAGLEN 16
 static char tags[][MAX_TAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
 
 #define MAX_TAGLEN 16
 static char tags[][MAX_TAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
 
+/* include(s) depending on the tags array */
+#include "flextile.h"
+
 static const Rule rules[] = {
        /* xprop(1):
         *      WM_CLASS(STRING) = instance, class
 static const Rule rules[] = {
        /* xprop(1):
         *      WM_CLASS(STRING) = instance, class
@@ -35,8 +38,12 @@ static const Rule rules[] = {
 
 /* layout(s) */
 static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
 
 /* layout(s) */
 static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
-static const int nmaster     = 1;    /* number of clients in master area */
 static const int resizehints = 1;    /* 1 means respect size hints in tiled resizals */
 static const int resizehints = 1;    /* 1 means respect size hints in tiled resizals */
+static const int layoutaxis[] = {
+       1,    /* layout axis: 1 = x, 2 = y; negative values mirror the layout, setting the master area to the right / bottom instead of left / top */
+       2,    /* master axis: 1 = x (from left to right), 2 = y (from top to bottom), 3 = z (monocle) */
+       2,    /* stack axis:  1 = x (from left to right), 2 = y (from top to bottom), 3 = z (monocle) */
+};
 static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
 
 #include "tcl.c"
 static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
 
 #include "tcl.c"
@@ -71,8 +78,8 @@ static const Key keys[] = {
        { MODKEY,                       XK_b,      togglebar,      {0} },
        { MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
        { MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
        { MODKEY,                       XK_b,      togglebar,      {0} },
        { MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
        { MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
-       { MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
-       { MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
+       { MODKEY,                       XK_i,      shiftmastersplit, {.i = +1} },   /* increase the number of tiled clients in the master area */
+       { MODKEY,                       XK_d,      shiftmastersplit, {.i = -1} },   /* reduce the number of tiled clients in the master area */
        { MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
        { MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
        { MODKEY,                       XK_Return, zoom,           {0} },
        { MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
        { MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
        { MODKEY,                       XK_Return, zoom,           {0} },
@@ -99,7 +106,11 @@ static const Key keys[] = {
        TAGKEYS(                        XK_7,                      6)
        TAGKEYS(                        XK_8,                      7)
        TAGKEYS(                        XK_9,                      8)
        TAGKEYS(                        XK_7,                      6)
        TAGKEYS(                        XK_8,                      7)
        TAGKEYS(                        XK_9,                      8)
-       { MODKEY|ShiftMask,             XK_q,      quitprompt,           {0} },
+       { MODKEY|ShiftMask,             XK_q,      quitprompt,       {0} },
+       { MODKEY|ControlMask,           XK_t,      rotatelayoutaxis, {.i = 0} },    /* 0 = layout axis */
+       { MODKEY|ControlMask,           XK_Tab,    rotatelayoutaxis, {.i = 1} },    /* 1 = master axis */
+       { MODKEY|ControlMask|ShiftMask, XK_Tab,    rotatelayoutaxis, {.i = 2} },    /* 2 = stack axis */
+       { MODKEY|ControlMask,           XK_Return, mirrorlayout,     {0} },
 };
 
 /* button definitions */
 };
 
 /* button definitions */
index 9590e25..f2b5f49 100644 (file)
--- a/config.h
+++ b/config.h
@@ -27,6 +27,9 @@ static const char *colors[][3]      = {
 #define MAX_TAGLEN 16
 static char tags[][MAX_TAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
 
 #define MAX_TAGLEN 16
 static char tags[][MAX_TAGLEN] = { "1", "2", "3", "4", "5", "6", "7", "8", "9" };
 
+/* include(s) depending on the tags array */
+#include "flextile.h"
+
 static const Rule rules[] = {
        /* xprop(1):
         *      WM_CLASS(STRING) = instance, class
 static const Rule rules[] = {
        /* xprop(1):
         *      WM_CLASS(STRING) = instance, class
@@ -38,8 +41,12 @@ static const Rule rules[] = {
 
 /* layout(s) */
 static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
 
 /* layout(s) */
 static const float mfact     = 0.55; /* factor of master area size [0.05..0.95] */
-static const int nmaster     = 1;    /* number of clients in master area */
 static const int resizehints = 1;    /* 1 means respect size hints in tiled resizals */
 static const int resizehints = 1;    /* 1 means respect size hints in tiled resizals */
+static const int layoutaxis[] = {
+       1,    /* layout axis: 1 = x, 2 = y; negative values mirror the layout, setting the master area to the right / bottom instead of left / top */
+       2,    /* master axis: 1 = x (from left to right), 2 = y (from top to bottom), 3 = z (monocle) */
+       2,    /* stack axis:  1 = x (from left to right), 2 = y (from top to bottom), 3 = z (monocle) */
+};
 static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
 
 #include "tcl.c"
 static const int lockfullscreen = 1; /* 1 will force focus on the fullscreen window */
 
 #include "tcl.c"
@@ -76,8 +83,8 @@ static const Key keys[] = {
        { MODKEY,                       XK_b,      togglebar,      {0} },
        { MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
        { MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
        { MODKEY,                       XK_b,      togglebar,      {0} },
        { MODKEY,                       XK_j,      focusstack,     {.i = +1 } },
        { MODKEY,                       XK_k,      focusstack,     {.i = -1 } },
-       { MODKEY,                       XK_i,      incnmaster,     {.i = +1 } },
-       { MODKEY,                       XK_d,      incnmaster,     {.i = -1 } },
+       { MODKEY,                       XK_i,      shiftmastersplit, {.i = +1} },   /* increase the number of tiled clients in the master area */
+       { MODKEY,                       XK_d,      shiftmastersplit, {.i = -1} },   /* reduce the number of tiled clients in the master area */
        { MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
        { MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
        { MODKEY,                       XK_Return, zoom,           {0} },
        { MODKEY,                       XK_h,      setmfact,       {.f = -0.05} },
        { MODKEY,                       XK_l,      setmfact,       {.f = +0.05} },
        { MODKEY,                       XK_Return, zoom,           {0} },
@@ -107,6 +114,10 @@ static const Key keys[] = {
        { MODKEY|ShiftMask,             XK_q,      quitprompt,     {0} },
        { MODKEY,                       XK_Escape, spawn,          {.v = lockcmd } },
        { MODKEY|ShiftMask,             XK_Escape, spawn,          {.v = screenshotcmd } },
        { MODKEY|ShiftMask,             XK_q,      quitprompt,     {0} },
        { MODKEY,                       XK_Escape, spawn,          {.v = lockcmd } },
        { MODKEY|ShiftMask,             XK_Escape, spawn,          {.v = screenshotcmd } },
+       { MODKEY|ControlMask,           XK_t,      rotatelayoutaxis, {.i = 0} },    /* 0 = layout axis */
+       { MODKEY|ControlMask,           XK_Tab,    rotatelayoutaxis, {.i = 1} },    /* 1 = master axis */
+       { MODKEY|ControlMask|ShiftMask, XK_Tab,    rotatelayoutaxis, {.i = 2} },    /* 2 = stack axis */
+       { MODKEY|ControlMask,           XK_Return, mirrorlayout,     {0} },
 };
 
 /* button definitions */
 };
 
 /* button definitions */
diff --git a/dwm.c b/dwm.c
index 2eed755..4aaa9ac 100644 (file)
--- a/dwm.c
+++ b/dwm.c
@@ -111,27 +111,6 @@ typedef struct {
        void (*arrange)(Monitor *);
 } Layout;
 
        void (*arrange)(Monitor *);
 } Layout;
 
-struct Monitor {
-       char ltsymbol[16];
-       float mfact;
-       int nmaster;
-       int num;
-       int by;               /* bar geometry */
-       int mx, my, mw, mh;   /* screen size */
-       int wx, wy, ww, wh;   /* window area  */
-       unsigned int seltags;
-       unsigned int sellt;
-       unsigned int tagset[2];
-       int showbar;
-       int topbar;
-       Client *clients;
-       Client *sel;
-       Client *stack;
-       Monitor *next;
-       Window barwin;
-       const Layout *lt[2];
-};
-
 typedef struct {
        const char *class;
        const char *instance;
 typedef struct {
        const char *class;
        const char *instance;
@@ -175,7 +154,6 @@ static long getstate(Window w);
 static int gettextprop(Window w, Atom atom, char *text, unsigned int size);
 static void grabbuttons(Client *c, int focused);
 static void grabkeys(void);
 static int gettextprop(Window w, Atom atom, char *text, unsigned int size);
 static void grabbuttons(Client *c, int focused);
 static void grabkeys(void);
-static void incnmaster(const Arg *arg);
 static void keypress(XEvent *e);
 static void killclient(const Arg *arg);
 static void layoutmenu(const Arg *arg);
 static void keypress(XEvent *e);
 static void killclient(const Arg *arg);
 static void layoutmenu(const Arg *arg);
@@ -683,17 +661,32 @@ configurerequest(XEvent *e)
 Monitor *
 createmon(void)
 {
 Monitor *
 createmon(void)
 {
+       unsigned int i;
        Monitor *m;
 
        m = ecalloc(1, sizeof(Monitor));
        m->tagset[0] = m->tagset[1] = startontag ? 1 : 0;
        m->mfact = mfact;
        Monitor *m;
 
        m = ecalloc(1, sizeof(Monitor));
        m->tagset[0] = m->tagset[1] = startontag ? 1 : 0;
        m->mfact = mfact;
-       m->nmaster = nmaster;
        m->showbar = showbar;
        m->topbar = topbar;
        m->lt[0] = &layouts[0];
        m->lt[1] = &layouts[1 % LENGTH(layouts)];
        strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
        m->showbar = showbar;
        m->topbar = topbar;
        m->lt[0] = &layouts[0];
        m->lt[1] = &layouts[1 % LENGTH(layouts)];
        strncpy(m->ltsymbol, layouts[0].symbol, sizeof m->ltsymbol);
+       m->ltaxis[0] = layoutaxis[0];
+       m->ltaxis[1] = layoutaxis[1];
+       m->ltaxis[2] = layoutaxis[2];
+       m->msplit = 1;
+       /* init tags, bars, layouts, axes, msplits and mfacts */
+       m->curtag = m->prevtag = 1;
+       for(i = 0; i < LENGTH(tags) + 1; i++){
+               m->showbars[i] = m->showbar;
+               m->lts[i] = &layouts[0];
+               m->mfacts[i] = m->mfact;
+               m->ltaxes[i][0] = m->ltaxis[0];
+               m->ltaxes[i][1] = m->ltaxis[1];
+               m->ltaxes[i][2] = m->ltaxis[2];
+               m->msplits[i] = m->msplit;
+       }
        return m;
 }
 
        return m;
 }
 
@@ -1027,13 +1020,6 @@ grabkeys(void)
        }
 }
 
        }
 }
 
-void
-incnmaster(const Arg *arg)
-{
-       selmon->nmaster = MAX(selmon->nmaster + arg->i, 0);
-       arrange(selmon);
-}
-
 #ifdef XINERAMA
 static int
 isuniquegeom(XineramaScreenInfo *unique, size_t n, XineramaScreenInfo *info)
 #ifdef XINERAMA
 static int
 isuniquegeom(XineramaScreenInfo *unique, size_t n, XineramaScreenInfo *info)
@@ -1636,7 +1622,7 @@ setlayout(const Arg *arg)
        if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
                selmon->sellt ^= 1;
        if (arg && arg->v)
        if (!arg || !arg->v || arg->v != selmon->lt[selmon->sellt])
                selmon->sellt ^= 1;
        if (arg && arg->v)
-               selmon->lt[selmon->sellt] = (Layout *)arg->v;
+               selmon->lt[selmon->sellt] = selmon->lts[selmon->curtag] = (Layout *)arg->v;
        strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol);
        if (selmon->sel)
                arrange(selmon);
        strncpy(selmon->ltsymbol, selmon->lt[selmon->sellt]->symbol, sizeof selmon->ltsymbol);
        if (selmon->sel)
                arrange(selmon);
@@ -1655,7 +1641,7 @@ setmfact(const Arg *arg)
        f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0;
        if (f < 0.05 || f > 0.95)
                return;
        f = arg->f < 1.0 ? arg->f + selmon->mfact : arg->f - 1.0;
        if (f < 0.05 || f > 0.95)
                return;
-       selmon->mfact = f;
+       selmon->mfact = selmon->mfacts[selmon->curtag] = f;
        arrange(selmon);
 }
 
        arrange(selmon);
 }
 
@@ -1798,38 +1784,10 @@ tagmon(const Arg *arg)
        sendmon(selmon->sel, dirtomon(arg->i));
 }
 
        sendmon(selmon->sel, dirtomon(arg->i));
 }
 
-void
-tile(Monitor *m)
-{
-       unsigned int i, n, h, mw, my, ty;
-       Client *c;
-
-       for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
-       if (n == 0)
-               return;
-
-       if (n > m->nmaster)
-               mw = m->nmaster ? m->ww * m->mfact : 0;
-       else
-               mw = m->ww;
-       for (i = my = ty = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
-               if (i < m->nmaster) {
-                       h = (m->wh - my) / (MIN(n, m->nmaster) - i);
-                       resize(c, m->wx, m->wy + my, mw - (2*c->bw), h - (2*c->bw), 0);
-                       if (my + HEIGHT(c) < m->wh)
-                               my += HEIGHT(c);
-               } else {
-                       h = (m->wh - ty) / (n - i);
-                       resize(c, m->wx + mw, m->wy + ty, m->ww - mw - (2*c->bw), h - (2*c->bw), 0);
-                       if (ty + HEIGHT(c) < m->wh)
-                               ty += HEIGHT(c);
-               }
-}
-
 void
 togglebar(const Arg *arg)
 {
 void
 togglebar(const Arg *arg)
 {
-       selmon->showbar = !selmon->showbar;
+       selmon->showbar = selmon->showbars[selmon->curtag] = !selmon->showbar;
        updatebarpos(selmon);
        XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
        arrange(selmon);
        updatebarpos(selmon);
        XMoveResizeWindow(dpy, selmon->barwin, selmon->wx, selmon->by, selmon->ww, bh);
        arrange(selmon);
@@ -1853,12 +1811,31 @@ void
 toggletag(const Arg *arg)
 {
        unsigned int newtags;
 toggletag(const Arg *arg)
 {
        unsigned int newtags;
+       unsigned int i;
 
        if (!selmon->sel)
                return;
        newtags = selmon->sel->tags ^ (arg->ui & TAGMASK);
        if (newtags) {
                selmon->sel->tags = newtags;
 
        if (!selmon->sel)
                return;
        newtags = selmon->sel->tags ^ (arg->ui & TAGMASK);
        if (newtags) {
                selmon->sel->tags = newtags;
+               if(newtags == ~0) {
+                       selmon->prevtag = selmon->curtag;
+                       selmon->curtag = 0;
+               }
+               if(!(newtags & 1 << (selmon->curtag - 1))) {
+                       selmon->prevtag = selmon->curtag;
+                       for (i=0; !(newtags & 1 << i); i++);
+                       selmon->curtag = i + 1;
+               }
+               selmon->sel->tags = newtags;
+               selmon->lt[selmon->sellt] = selmon->lts[selmon->curtag];
+               selmon->mfact = selmon->mfacts[selmon->curtag];
+               if (selmon->showbar != selmon->showbars[selmon->curtag])
+                       togglebar(NULL);
+               selmon->ltaxis[0] = selmon->ltaxes[selmon->curtag][0];
+               selmon->ltaxis[1] = selmon->ltaxes[selmon->curtag][1];
+               selmon->ltaxis[2] = selmon->ltaxes[selmon->curtag][2];
+               selmon->msplit = selmon->msplits[selmon->curtag];
                focus(NULL);
                arrange(selmon);
        }
                focus(NULL);
                arrange(selmon);
        }
@@ -2165,11 +2142,33 @@ updatewmhints(Client *c)
 void
 view(const Arg *arg)
 {
 void
 view(const Arg *arg)
 {
+       unsigned int i;
+
        if(arg->ui && (arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
                return;
        selmon->seltags ^= 1; /* toggle sel tagset */
        if(arg->ui && (arg->ui & TAGMASK) == selmon->tagset[selmon->seltags])
                return;
        selmon->seltags ^= 1; /* toggle sel tagset */
-       if (arg->ui & TAGMASK)
+       if (arg->ui & TAGMASK) {
                selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
                selmon->tagset[selmon->seltags] = arg->ui & TAGMASK;
+               selmon->prevtag = selmon->curtag;
+               if(arg->ui == ~0)
+                       selmon->curtag = 0;
+               else {
+                       for (i=0; !(arg->ui & 1 << i); i++);
+                       selmon->curtag = i + 1;
+               }
+       } else {
+               selmon->prevtag = selmon->curtag ^ selmon->prevtag;
+               selmon->curtag ^= selmon->prevtag;
+               selmon->prevtag = selmon->curtag ^ selmon->prevtag;
+       }
+       selmon->lt[selmon->sellt] = selmon->lts[selmon->curtag];
+       selmon->mfact = selmon->mfacts[selmon->curtag];
+       if(selmon->showbar != selmon->showbars[selmon->curtag])
+               togglebar(NULL);
+       selmon->ltaxis[0] = selmon->ltaxes[selmon->curtag][0];
+       selmon->ltaxis[1] = selmon->ltaxes[selmon->curtag][1];
+       selmon->ltaxis[2] = selmon->ltaxes[selmon->curtag][2];
+       selmon->msplit = selmon->msplits[selmon->curtag];
        focus(NULL);
        arrange(selmon);
 }
        focus(NULL);
        arrange(selmon);
 }
diff --git a/flextile.h b/flextile.h
new file mode 100644 (file)
index 0000000..edab893
--- /dev/null
@@ -0,0 +1,163 @@
+/* See LICENSE file for copyright and license details. */
+/* © 2010 joten <joten@freenet.de> */
+
+struct Monitor {
+       char ltsymbol[16];
+       float mfact;
+       double mfacts[LENGTH(tags) + 1];
+       int ltaxis[3];
+       int ltaxes[LENGTH(tags) + 1][3];
+       int num;
+       int curtag;
+       int prevtag;
+       int by;               /* bar geometry */
+       int mx, my, mw, mh;   /* screen size */
+       int wx, wy, ww, wh;   /* window area  */
+       unsigned int msplit;
+       unsigned int msplits[LENGTH(tags) + 1];
+       unsigned int seltags;
+       unsigned int sellt;
+       unsigned int tagset[2];
+       int showbar;
+       int showbars[LENGTH(tags) + 1];
+       int topbar;
+       Client *clients;
+       Client *sel;
+       Client *stack;
+       Monitor *next;
+       Window barwin;
+       const Layout *lt[2];
+       const Layout *lts[LENGTH(tags) + 1];
+};
+
+/* function declarations */
+static void mirrorlayout(const Arg *arg);
+static void rotatelayoutaxis(const Arg *arg);
+static void shiftmastersplit(const Arg *arg);
+
+void
+mirrorlayout(const Arg *arg)
+{
+       if(!selmon->lt[selmon->sellt]->arrange)
+               return;
+       selmon->ltaxis[0] *= -1;
+       selmon->ltaxes[selmon->curtag][0] = selmon->ltaxis[0];
+       arrange(selmon);
+}
+
+void
+rotatelayoutaxis(const Arg *arg)
+{
+       if(!selmon->lt[selmon->sellt]->arrange)
+               return;
+       if(arg->i == 0) {
+               if(selmon->ltaxis[0] > 0)
+                       selmon->ltaxis[0] = selmon->ltaxis[0] + 1 > 2 ? 1 : selmon->ltaxis[0] + 1;
+               else
+                       selmon->ltaxis[0] = selmon->ltaxis[0] - 1 < -2 ? -1 : selmon->ltaxis[0] - 1;
+       } else
+               selmon->ltaxis[arg->i] = selmon->ltaxis[arg->i] + 1 > 3 ? 1 : selmon->ltaxis[arg->i] + 1;
+       selmon->ltaxes[selmon->curtag][arg->i] = selmon->ltaxis[arg->i];
+       arrange(selmon);
+}
+
+void
+shiftmastersplit(const Arg *arg)
+{
+       unsigned int n;
+       Client *c;
+
+       for(n = 0, c = nexttiled(selmon->clients); c; c = nexttiled(c->next), n++);
+       if(!arg || !selmon->lt[selmon->sellt]->arrange || selmon->msplit + arg->i < 1 || selmon->msplit + arg->i > n)
+               return;
+       selmon->msplit += arg->i;
+       selmon->msplits[selmon->curtag] = selmon->msplit;
+       arrange(selmon);
+}
+
+void
+tile(Monitor *m)
+{
+       char sym1 = 61, sym2 = 93, sym3 = 61, sym;
+       int x1 = m->wx, y1 = m->wy, h1 = m->wh, w1 = m->ww, X1 = x1 + w1, Y1 = y1 + h1;
+       int x2 = m->wx, y2 = m->wy, h2 = m->wh, w2 = m->ww, X2 = x2 + w2, Y2 = y2 + h2;
+       unsigned int i, n, n1, n2;
+       Client *c;
+
+       for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
+       if(m->msplit > n)
+               m->msplit = (n == 0) ? 1 : n;
+       /* layout symbol */
+       if(abs(m->ltaxis[0]) == m->ltaxis[1])    /* explicitly: ((abs(m->ltaxis[0]) == 1 && m->ltaxis[1] == 1) || (abs(m->ltaxis[0]) == 2 && m->ltaxis[1] == 2)) */
+               sym1 = 124;
+       if(abs(m->ltaxis[0]) == m->ltaxis[2])
+               sym3 = 124;
+       if(m->ltaxis[1] == 3)
+               sym1 = (n == 0) ? 0 : m->msplit;
+       if(m->ltaxis[2] == 3)
+               sym3 = (n == 0) ? 0 : n - m->msplit;
+       if(m->ltaxis[0] < 0) {
+               sym = sym1;
+               sym1 = sym3;
+               sym2 = 91;
+               sym3 = sym;
+       }
+       if(m->msplit == 1) {
+               if(m->ltaxis[0] > 0)
+                       sym1 = 91;
+               else
+                       sym3 = 93;
+       }
+       if(m->msplit > 1 && m->ltaxis[1] == 3 && m->ltaxis[2] == 3)
+               snprintf(m->ltsymbol, sizeof m->ltsymbol, "%d%c%d", sym1, sym2, sym3);
+       else if((m->msplit > 1 && m->ltaxis[1] == 3 && m->ltaxis[0] > 0) || (m->ltaxis[2] == 3 && m->ltaxis[0] < 0))
+               snprintf(m->ltsymbol, sizeof m->ltsymbol, "%d%c%c", sym1, sym2, sym3);
+       else if((m->ltaxis[2] == 3 && m->ltaxis[0] > 0) || (m->msplit > 1 && m->ltaxis[1] == 3 && m->ltaxis[0] < 0))
+               snprintf(m->ltsymbol, sizeof m->ltsymbol, "%c%c%d", sym1, sym2, sym3);
+       else
+               snprintf(m->ltsymbol, sizeof m->ltsymbol, "%c%c%c", sym1, sym2, sym3);
+       if(n == 0)
+               return;
+       /* master and stack area */
+       if(abs(m->ltaxis[0]) == 1 && n > m->msplit) {
+               w1 *= m->mfact;
+               w2 -= w1;
+               x1 += (m->ltaxis[0] < 0) ? w2 : 0;
+               x2 += (m->ltaxis[0] < 0) ? 0 : w1;
+               X1 = x1 + w1;
+               X2 = x2 + w2;
+       } else if(abs(m->ltaxis[0]) == 2 && n > m->msplit) {
+               h1 *= m->mfact;
+               h2 -= h1;
+               y1 += (m->ltaxis[0] < 0) ? h2 : 0;
+               y2 += (m->ltaxis[0] < 0) ? 0 : h1;
+               Y1 = y1 + h1;
+               Y2 = y2 + h2;
+       }
+       /* master */
+       n1 = (m->ltaxis[1] != 1 || w1 / m->msplit < bh) ? 1 : m->msplit;
+       n2 = (m->ltaxis[1] != 2 || h1 / m->msplit < bh) ? 1 : m->msplit;
+       for(i = 0, c = nexttiled(m->clients); i < m->msplit; c = nexttiled(c->next), i++) {
+               resize(c, x1, y1,
+                       (m->ltaxis[1] == 1 && i + 1 == m->msplit) ? X1 - x1 - 2 * c->bw : w1 / n1 - 2 * c->bw,
+                       (m->ltaxis[1] == 2 && i + 1 == m->msplit) ? Y1 - y1 - 2 * c->bw : h1 / n2 - 2 * c->bw, False);
+               if(n1 > 1)
+                       x1 = c->x + WIDTH(c);
+               if(n2 > 1)
+                       y1 = c->y + HEIGHT(c);
+       }
+       /* stack */
+       if(n > m->msplit) {
+               n1 = (m->ltaxis[2] != 1 || w2 / (n - m->msplit) < bh) ? 1 : n - m->msplit;
+               n2 = (m->ltaxis[2] != 2 || h2 / (n - m->msplit) < bh) ? 1 : n - m->msplit;
+               for(i = 0; c; c = nexttiled(c->next), i++) {
+                       resize(c, x2, y2,
+                               (m->ltaxis[2] == 1 && i + 1 == n - m->msplit) ? X2 - x2 - 2 * c->bw : w2 / n1 - 2 * c->bw,
+                               (m->ltaxis[2] == 2 && i + 1 == n - m->msplit) ? Y2 - y2 - 2 * c->bw : h2 / n2 - 2 * c->bw, False);
+                       if(n1 > 1)
+                               x2 = c->x + WIDTH(c);
+                       if(n2 > 1)
+                               y2 = c->y + HEIGHT(c);
+               }
+       }
+}