dvtm

dynamic virtual terminal manager - with my changes
git clone https://pi.duncano.de/git/dvtm.git
Log | Files | Refs | README | LICENSE

commit 191b9ee667950234b3b0283f6c2e2ce0f7d93e73
parent 50b9e5e922213befe57fe1d3e4432277076d9f5c
Author: Mark Edgar <medgar123@gmail.com>
Date:   Wed, 18 Jun 2014 22:17:49 +0200

Vertical stack layout. All windows have the full screen width.

Diffstat:
vstack.c | 37+++++++++++++++++++++++++++++++++++++
1 file changed, 37 insertions(+), 0 deletions(-)

diff --git a/vstack.c b/vstack.c @@ -0,0 +1,37 @@ +/* A vertical stack layout, all windows have the full screen width. */ +static void vstack(void) +{ + unsigned int i, m, n, ny, nh, mh, th; + Client *c; + + for (n = 0, m = 0, c = clients; c; c = c->next, n++) + if (c->minimized) + m++; + + if (n == 1) + mh = wah; + else if (n - 1 == m) + mh = wah - m; + else + mh = screen.mfact * (wah - m); + /* true if there are at least 2 non minimized clients */ + if (n - 1 > m) + th = (wah - mh) / (n - 1 - m); + + /* TODO: place all minimized windows on the last line */ + + ny = way; + for (i = 0, c = clients; c; c = c->next, i++) { + if (i == 0) { /* master */ + nh = mh; + } else if (i == n - m - 1) { /* last not minimized client */ + nh = (way + wah) - ny - m; + } else if (c->minimized) { + nh = 1; + } else { /* normal non minimized tile window */ + nh = th; + } + resize(c, wax, ny, waw, nh); + ny += nh; + } +}