or rows (horizontal stack) from the stacking (non-master) area.
Add windows to master area
.It Cm M-.
Remove windows from master area
Add windows to master area
.It Cm M-.
Remove windows from master area
+.It Cm M-S-,
+Add columns/rows to stacking area
+.It Cm M-S-.
+Remove columns/rows from stacking area
.It Cm M- Ns Aq Cm Return
Move current window to master area
.It Xo
.It Cm M- Ns Aq Cm Return
Move current window to master area
.It Xo
struct {
int horizontal_msize;
int horizontal_mwin;
struct {
int horizontal_msize;
int horizontal_mwin;
int vertical_msize;
int vertical_mwin;
int vertical_msize;
int vertical_mwin;
#define SWM_ARG_ID_CYCLEWS_DOWN (13)
#define SWM_ARG_ID_CYCLESC_UP (14)
#define SWM_ARG_ID_CYCLESC_DOWN (15)
#define SWM_ARG_ID_CYCLEWS_DOWN (13)
#define SWM_ARG_ID_CYCLESC_UP (14)
#define SWM_ARG_ID_CYCLESC_DOWN (15)
+#define SWM_ARG_ID_COLINC (16)
+#define SWM_ARG_ID_COLDEC (17)
+#define SWM_ARG_ID_ROWINC (16)
+#define SWM_ARG_ID_ROWDEL (17)
#define SWM_ARG_ID_SS_ALL (0)
#define SWM_ARG_ID_SS_WINDOW (1)
#define SWM_ARG_ID_DONTCENTER (0)
#define SWM_ARG_ID_SS_ALL (0)
#define SWM_ARG_ID_SS_WINDOW (1)
#define SWM_ARG_ID_DONTCENTER (0)
XWindowChanges wc;
struct swm_geometry win_g, r_g = *g;
struct ws_win *win, *winfocus;
XWindowChanges wc;
struct swm_geometry win_g, r_g = *g;
struct ws_win *win, *winfocus;
- int i, j, w_inc, h_inc, w_base, h_base;
+ int i, j, s, w_inc, h_inc, w_base, h_base, stacks;
int hrh, extra, h_slice, last_h = 0;
int split, colno, winno, mwin, msize, mscale;
int remain, missing, v_slice;;
int hrh, extra, h_slice, last_h = 0;
int split, colno, winno, mwin, msize, mscale;
int remain, missing, v_slice;;
w_base = win->sh.base_width;
mwin = ws->l_state.horizontal_mwin;
mscale = ws->l_state.horizontal_msize;
w_base = win->sh.base_width;
mwin = ws->l_state.horizontal_mwin;
mscale = ws->l_state.horizontal_msize;
+ stacks = ws->l_state.horizontal_stacks;
SWAPXY(&r_g);
} else {
w_inc = win->sh.height_inc;
w_base = win->sh.base_height;
mwin = ws->l_state.vertical_mwin;
mscale = ws->l_state.vertical_msize;
SWAPXY(&r_g);
} else {
w_inc = win->sh.height_inc;
w_base = win->sh.base_height;
mwin = ws->l_state.vertical_mwin;
mscale = ws->l_state.vertical_msize;
+ stacks = ws->l_state.vertical_stacks;
+ if (stacks > winno - mwin)
+ stacks = winno - mwin;
+
h_slice = r_g.h / SWM_H_SLICE;
if (mwin && winno > mwin) {
v_slice = r_g.w / SWM_V_SLICE;
split = mwin;
colno = split;
h_slice = r_g.h / SWM_H_SLICE;
if (mwin && winno > mwin) {
v_slice = r_g.w / SWM_V_SLICE;
split = mwin;
colno = split;
- msize = v_slice * mscale;
+ win_g.w = v_slice * mscale;
if (w_inc > 1 && w_inc < v_slice) {
/* adjust for window's requested size increment */
if (w_inc > 1 && w_inc < v_slice) {
/* adjust for window's requested size increment */
if (flip)
win_g.x += r_g.w - msize;
} else {
if (flip)
win_g.x += r_g.w - msize;
} else {
- colno = winno;
- split = 0;
+ if (stacks > 1) {
+ colno = split = (winno - mwin) / stacks;
+ } else {
+ split = 0;
+ colno = winno;
+ }
}
hrh = r_g.h / colno;
extra = r_g.h - (colno * hrh);
win_g.h = hrh - 2;
/* stack all the tiled windows */
}
hrh = r_g.h / colno;
extra = r_g.h - (colno * hrh);
win_g.h = hrh - 2;
/* stack all the tiled windows */
TAILQ_FOREACH(win, &ws->winlist, entry) {
if (win->transient != 0 || win->floating != 0)
continue;
if (split && i == split) {
TAILQ_FOREACH(win, &ws->winlist, entry) {
if (win->transient != 0 || win->floating != 0)
continue;
if (split && i == split) {
+ colno = (winno - split) / s;
+ if (stacks == 1)
+ colno += (winno - split) % s;
+ split = split + colno;
hrh = (r_g.h / colno);
extra = r_g.h - (colno * hrh);
if (flip)
win_g.x = r_g.x;
else
hrh = (r_g.h / colno);
extra = r_g.h - (colno * hrh);
if (flip)
win_g.x = r_g.x;
else
- win_g.x += msize + 2;
- win_g.w = r_g.w - (msize + 2);
+ win_g.x += win_g.w + 2;
+ win_g.w = (r_g.w - (msize + 2) - (stacks * 2)) / stacks;
+ s--;
j = 0;
}
win_g.h = hrh - 2;
j = 0;
}
win_g.h = hrh - 2;
case SWM_ARG_ID_STACKINIT:
ws->l_state.vertical_msize = SWM_V_SLICE / 2;
ws->l_state.vertical_mwin = 1;
case SWM_ARG_ID_STACKINIT:
ws->l_state.vertical_msize = SWM_V_SLICE / 2;
ws->l_state.vertical_mwin = 1;
+ ws->l_state.vertical_stacks = 1;
break;
case SWM_ARG_ID_MASTERSHRINK:
if (ws->l_state.vertical_msize > 1)
break;
case SWM_ARG_ID_MASTERSHRINK:
if (ws->l_state.vertical_msize > 1)
case SWM_ARG_ID_MASTERDEL:
if (ws->l_state.vertical_mwin > 0)
ws->l_state.vertical_mwin--;
case SWM_ARG_ID_MASTERDEL:
if (ws->l_state.vertical_mwin > 0)
ws->l_state.vertical_mwin--;
+ case SWM_ARG_ID_COLINC:
+ ws->l_state.vertical_stacks++;
+ break;
+ case SWM_ARG_ID_COLDEC:
+ if (ws->l_state.vertical_stacks > 1)
+ ws->l_state.vertical_stacks--;
case SWM_ARG_ID_STACKINIT:
ws->l_state.horizontal_mwin = 1;
ws->l_state.horizontal_msize = SWM_H_SLICE / 2;
case SWM_ARG_ID_STACKINIT:
ws->l_state.horizontal_mwin = 1;
ws->l_state.horizontal_msize = SWM_H_SLICE / 2;
+ ws->l_state.horizontal_stacks = 1;
break;
case SWM_ARG_ID_MASTERSHRINK:
if (ws->l_state.horizontal_msize > 1)
break;
case SWM_ARG_ID_MASTERSHRINK:
if (ws->l_state.horizontal_msize > 1)
if (ws->l_state.horizontal_mwin > 0)
ws->l_state.horizontal_mwin--;
break;
if (ws->l_state.horizontal_mwin > 0)
ws->l_state.horizontal_mwin--;
break;
+ case SWM_ARG_ID_COLINC:
+ ws->l_state.horizontal_stacks++;
+ break;
+ case SWM_ARG_ID_COLDEC:
+ if (ws->l_state.horizontal_stacks > 1)
+ ws->l_state.horizontal_stacks--;
{ MODKEY, XK_l, stack_config, {.id = SWM_ARG_ID_MASTERGROW} },
{ MODKEY, XK_comma, stack_config, {.id = SWM_ARG_ID_MASTERADD} },
{ MODKEY, XK_period, stack_config, {.id = SWM_ARG_ID_MASTERDEL} },
{ MODKEY, XK_l, stack_config, {.id = SWM_ARG_ID_MASTERGROW} },
{ MODKEY, XK_comma, stack_config, {.id = SWM_ARG_ID_MASTERADD} },
{ MODKEY, XK_period, stack_config, {.id = SWM_ARG_ID_MASTERDEL} },
+ { MODKEY | ShiftMask, XK_comma, stack_config, {.id = SWM_ARG_ID_COLINC} },
+ { MODKEY | ShiftMask, XK_period, stack_config, {.id = SWM_ARG_ID_COLDEC} },
{ MODKEY, XK_Return, swapwin, {.id = SWM_ARG_ID_SWAPMAIN} },
{ MODKEY, XK_j, focus, {.id = SWM_ARG_ID_FOCUSNEXT} },
{ MODKEY, XK_k, focus, {.id = SWM_ARG_ID_FOCUSPREV} },
{ MODKEY, XK_Return, swapwin, {.id = SWM_ARG_ID_SWAPMAIN} },
{ MODKEY, XK_j, focus, {.id = SWM_ARG_ID_FOCUSNEXT} },
{ MODKEY, XK_k, focus, {.id = SWM_ARG_ID_FOCUSPREV} },