forked from martanne/dvtm
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathvstack.c
More file actions
27 lines (24 loc) · 684 Bytes
/
vstack.c
File metadata and controls
27 lines (24 loc) · 684 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
/* A vertical stack layout, all windows have the full screen width. */
static void vstack(void)
{
unsigned int i, n, ny, nh, m, mh, th;
Client *c;
for (n = 0, c = nextvisible(clients); c; c = nextvisible(c->next))
if (!c->minimized)
n++;
m = MAX(1, MIN(n, screen.nmaster));
mh = (n == m ? wah : screen.mfact * wah);
th = n == m ? 0 : (wah - mh) / (n - m);
ny = way;
for (i = 0, c = nextvisible(clients); c; c = nextvisible(c->next)) {
if (c->minimized)
continue;
if (i < m) /* master */
nh = (i < m - 1) ? mh / m : (way + mh) - ny;
else /* tile window */
nh = (i < n - 1) ? th : (way + wah) - ny;
resize(c, wax, ny, waw, nh);
ny += nh;
i++;
}
}