summaryrefslogtreecommitdiff
path: root/vanitygaps.c
diff options
context:
space:
mode:
Diffstat (limited to 'vanitygaps.c')
-rw-r--r--vanitygaps.c33
1 files changed, 17 insertions, 16 deletions
diff --git a/vanitygaps.c b/vanitygaps.c
index 4111d1e..e1e955b 100644
--- a/vanitygaps.c
+++ b/vanitygaps.c
@@ -150,7 +150,7 @@ getgaps(Monitor *m, int *oh, int *ov, int *ih, int *iv, unsigned int *nc)
#endif // PERTAG_PATCH
Client *c;
- for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
+ for (n = 0, c = nexttiled(m->cl->clients, m); c; c = nexttiled(c->next, m), n++);
if (smartgaps && n == 1) {
oe = 0; // outer gaps disabled when only one client
}
@@ -170,11 +170,11 @@ getfacts(Monitor *m, int msize, int ssize, float *mf, float *sf, int *mr, int *s
int mtotal = 0, stotal = 0;
Client *c;
- for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++);
+ for (n = 0, c = nexttiled(m->cl->clients, m); c; c = nexttiled(c->next, m), n++);
mfacts = MIN(n, m->nmaster);
sfacts = n - m->nmaster;
- for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++)
+ for (n = 0, c = nexttiled(m->cl->clients, m); c; c = nexttiled(c->next, m), n++)
if (n < m->nmaster)
mtotal += msize / mfacts;
else
@@ -224,7 +224,7 @@ bstack(Monitor *m)
getfacts(m, mw, sw, &mfacts, &sfacts, &mrest, &srest);
- for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
+ for (i = 0, c = nexttiled(m->cl->clients, m); c; c = nexttiled(c->next, m), 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) + iv;
@@ -266,7 +266,7 @@ bstackhoriz(Monitor *m)
getfacts(m, mw, sh, &mfacts, &sfacts, &mrest, &srest);
- for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
+ for (i = 0, c = nexttiled(m->cl->clients, m); c; c = nexttiled(c->next, m), 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) + iv;
@@ -327,7 +327,7 @@ centeredmaster(Monitor *m)
}
/* calculate facts */
- for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++) {
+ for (n = 0, c = nexttiled(m->cl->clients, m); c; c = nexttiled(c->next, m), n++) {
if (!m->nmaster || n < m->nmaster)
mfacts += 1;
else if ((n - m->nmaster) % 2)
@@ -336,7 +336,7 @@ centeredmaster(Monitor *m)
rfacts += 1; // total factor of right hand stack area
}
- for (n = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), n++)
+ for (n = 0, c = nexttiled(m->cl->clients, m); c; c = nexttiled(c->next, m), n++)
if (!m->nmaster || n < m->nmaster)
mtotal += mh / mfacts;
else if ((n - m->nmaster) % 2)
@@ -348,7 +348,7 @@ centeredmaster(Monitor *m)
lrest = lh - ltotal;
rrest = rh - rtotal;
- for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
+ for (i = 0, c = nexttiled(m->cl->clients, m); c; c = nexttiled(c->next, m), i++) {
if (!m->nmaster || i < m->nmaster) {
/* nmaster clients are stacked vertically, in the center of the screen */
resize(c, mx, my, mw - (2*c->bw), (mh / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), 0);
@@ -407,7 +407,7 @@ centeredfloatingmaster(Monitor *m)
getfacts(m, mw, sw, &mfacts, &sfacts, &mrest, &srest);
- for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
+ for (i = 0, c = nexttiled(m->cl->clients, m); c; c = nexttiled(c->next, m), i++)
if (i < m->nmaster) {
/* nmaster clients are stacked horizontally, in the center of the screen */
resize(c, mx, my, (mw / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0);
@@ -455,7 +455,7 @@ deck(Monitor *m)
if (n - m->nmaster > 0) /* override layout symbol */
snprintf(m->ltsymbol, sizeof m->ltsymbol, "D %d", n - m->nmaster);
- for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
+ for (i = 0, c = nexttiled(m->cl->clients, m); c; c = nexttiled(c->next, m), i++)
if (i < m->nmaster) {
resize(c, mx, my, mw - (2*c->bw), (mh / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), 0);
my += HEIGHT(c) + ih;
@@ -486,7 +486,7 @@ fibonacci(Monitor *m, int s)
nw = m->ww - 2*ov;
nh = m->wh - 2*oh;
- for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next)) {
+ for (i = 0, c = nexttiled(m->cl->clients, m); c; c = nexttiled(c->next, m)) {
if (r) {
if ((i % 2 && (nh - ih) / 2 <= (bh + 2*c->bw))
|| (!(i % 2) && (nw - iv) / 2 <= (bh + 2*c->bw))) {
@@ -599,7 +599,7 @@ gaplessgrid(Monitor *m)
x = m->wx + ov;
y = m->wy + oh;
- for (i = 0, c = nexttiled(m->clients); c; i++, c = nexttiled(c->next)) {
+ for (i = 0, c = nexttiled(m->cl->clients, m); c; i++, c = nexttiled(c->next, m)) {
if (i/rows + 1 > cols - n%cols) {
rows = n/cols + 1;
ch = (m->wh - 2*oh - ih * (rows - 1)) / rows;
@@ -645,7 +645,7 @@ grid(Monitor *m)
cw = (m->ww - 2*ov - iv * (cols - 1)) / (cols ? cols : 1);
chrest = (m->wh - 2*oh - ih * (rows - 1)) - ch * rows;
cwrest = (m->ww - 2*ov - iv * (cols - 1)) - cw * cols;
- for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++) {
+ for (i = 0, c = nexttiled(m->cl->clients, m); c; c = nexttiled(c->next, m), i++) {
cc = i / rows;
cr = i % rows;
cx = m->wx + ov + cc * (cw + iv) + MIN(cc, cwrest);
@@ -698,7 +698,7 @@ horizgrid(Monitor *m) {
mrest = mw - (mw / ntop) * ntop;
srest = sw - (sw / nbottom) * nbottom;
- for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
+ for (i = 0, c = nexttiled(m->cl->clients, m); c; c = nexttiled(c->next, m), i++)
if (i < ntop) {
resize(c, mx, my, (mw / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), mh - (2*c->bw), 0);
mx += WIDTH(c) + iv;
@@ -745,7 +745,7 @@ nrowgrid(Monitor *m)
ch = (m->wh - 2*oh - ih*(rows - 1)) / rows;
uh = ch;
- for (c = nexttiled(m->clients); c; c = nexttiled(c->next), ci++) {
+ for (c = nexttiled(m->cl->clients, m); c; c = nexttiled(c->next, m), ci++) {
if (ci == cols) {
uw = 0;
ci = 0;
@@ -798,7 +798,8 @@ tile(Monitor *m)
getfacts(m, mh, sh, &mfacts, &sfacts, &mrest, &srest);
- for (i = 0, c = nexttiled(m->clients); c; c = nexttiled(c->next), i++)
+// for (i = 0, c = nexttiled(m->cl->clients, m); c; c = nexttiled(c->next, m), i++)
+ for (i = 0, c = nexttiled(m->cl->clients, m); c; c = nexttiled(c->next, m), i++);
if (i < m->nmaster) {
resize(c, sx, sy, sw - (2*c->bw), (mh / mfacts) + (i < mrest ? 1 : 0) - (2*c->bw), 0);
sy += HEIGHT(c) + ih;
Software created with 💖