Use for instead of while loop
[dvtm.git] / vstack.c
blob4f9daf8d451633ce49d7415007d780a7dc2c8781
1 /* A vertical stack layout, all windows have the full screen width. */
2 static void vstack(void)
4 unsigned int i, n, ny, nh, mh, th;
5 Client *c;
7 for (n = 0, c = nextvisible(clients); c; c = nextvisible(c->next))
8 if (!c->minimized)
9 n++;
11 mh = n <= 1 ? wah : screen.mfact * wah;
12 th = n <= 1 ? 0 : (wah - mh) / (n - 1);
13 ny = way;
15 for (i = 0, c = nextvisible(clients); c; c = nextvisible(c->next)) {
16 if (c->minimized)
17 continue;
18 if (i == 0) /* master */
19 nh = mh;
20 else /* tile window */
21 nh = (i < n - 1) ? th : (way + wah) - ny;
22 resize(c, wax, ny, waw, nh);
23 ny += nh;
24 i++;