40 lines
869 B
C
40 lines
869 B
C
|
static void
|
||
|
bstack(Monitor *m)
|
||
|
{
|
||
|
unsigned int i, n;
|
||
|
int mx = 0, my = 0, mh = 0, mw = 0;
|
||
|
int sx = 0, sy = 0, sh = 0, sw = 0;
|
||
|
float mfacts, sfacts;
|
||
|
int mrest, srest;
|
||
|
Client *c;
|
||
|
|
||
|
for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
|
||
|
|
||
|
if (n == 0)
|
||
|
return;
|
||
|
|
||
|
sx = mx = m->wx;
|
||
|
sy = my = m->wy;
|
||
|
sh = mh = m->wh;
|
||
|
sw = mw = m->ww;
|
||
|
|
||
|
if (m->nmaster && n > m->nmaster) {
|
||
|
sh = mh * (1 - m->mfact);
|
||
|
mh = mh * m->mfact;
|
||
|
sy = my + mh;
|
||
|
}
|
||
|
|
||
|
getfacts(m, mw, sw, &mfacts, &sfacts, &mrest, &srest);
|
||
|
|
||
|
for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
|
||
|
if (i < m->nmaster) {
|
||
|
resize(c, mx, my, (mw / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0);
|
||
|
mx += WIDTH(c);
|
||
|
} else {
|
||
|
resize(c, sx, sy, (sw / sfacts) + ((i - m->nmaster) < srest ? 1 : 0) - (2*c->bw), sh - (2*c->bw), 0);
|
||
|
sx += WIDTH(c);
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
|