Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
tree: eac6e7627f
Fetching contributors…

Octocat-spinner-32-eaf2f5

Cannot retrieve contributors at this time

file 30 lines (28 sloc) 0.825 kb
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 28 29
static void
bstack(Monitor *m) {
int x, y, h, w, mh;
unsigned int i, n;
Client *c;

for(n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
if(n == 0)
return;
/* master */
c = nexttiled(m->clients);
mh = m->mfacts[m->curtag] * m->wh;
resize(c, m->wx, m->wy, m->ww - 2 * c->bw, (n == 1 ? m->wh : mh) - 2 * c->bw, False);
if(--n == 0)
return;
/* tile stack */
x = m->wx;
y = (m->wy + mh > c->y + c->h) ? c->y + c->h + 2 * c->bw : m->wy + mh;
w = m->ww / n;
h = (m->wy + mh > c->y + c->h) ? m->wy + m->wh - y : m->wh - mh;
if(w < bh)
w = m->ww;
for(i = 0, c = nexttiled(c->next); c; c = nexttiled(c->next), i++) {
resize(c, x, y, /* remainder */ ((i + 1 == n)
? m->wx + m->ww - x - 2 * c->bw : w - 2 * c->bw), h - 2 * c->bw, False);
if(w != m->ww)
x = c->x + WIDTH(c);
}
}
Something went wrong with that request. Please try again.