feat: hide vacant tags patch
This commit is contained in:
parent
8fe685e02e
commit
bb0af060e5
1 changed files with 13 additions and 7 deletions
20
dwm.c
20
dwm.c
|
@ -546,9 +546,14 @@ buttonpress(XEvent *e)
|
||||||
i = 0;
|
i = 0;
|
||||||
x = TEXTW(mwsymbol);
|
x = TEXTW(mwsymbol);
|
||||||
|
|
||||||
do
|
unsigned int occ = 0;
|
||||||
|
for(c = m->clients; c; c=c->next)
|
||||||
|
occ |= c->tags[metaws] == TAGMASK ? 0 : c->tags[metaws];
|
||||||
|
do {
|
||||||
|
if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i))
|
||||||
|
continue;
|
||||||
x += TEXTW(tags[i]);
|
x += TEXTW(tags[i]);
|
||||||
while (ev->x >= x && ++i < LENGTH(tags));
|
} while (ev->x >= x && ++i < LENGTH(tags));
|
||||||
|
|
||||||
if (ev->x < TEXTW(mwsymbol))
|
if (ev->x < TEXTW(mwsymbol))
|
||||||
click = ClkMwSymbol;
|
click = ClkMwSymbol;
|
||||||
|
@ -839,7 +844,7 @@ drawbar(Monitor *m)
|
||||||
}
|
}
|
||||||
|
|
||||||
for (c = m->clients; c; c = c->next) {
|
for (c = m->clients; c; c = c->next) {
|
||||||
occ |= c->tags[metaws];
|
occ |= c->tags[metaws] == TAGMASK ? 0 : c->tags[metaws];
|
||||||
if (c->isurgent)
|
if (c->isurgent)
|
||||||
urg |= c->tags[metaws];
|
urg |= c->tags[metaws];
|
||||||
}
|
}
|
||||||
|
@ -848,13 +853,14 @@ drawbar(Monitor *m)
|
||||||
x = drw_text(drw, x, 0, w, bh, lrpad / 2, mwsymbol, 0);
|
x = drw_text(drw, x, 0, w, bh, lrpad / 2, mwsymbol, 0);
|
||||||
|
|
||||||
for (i = 0; i < LENGTH(tags); i++) {
|
for (i = 0; i < LENGTH(tags); i++) {
|
||||||
|
if(!(occ & 1 << i || m->tagset[m->seltags] & 1 << i))
|
||||||
|
continue;
|
||||||
w = TEXTW(tags[i]);
|
w = TEXTW(tags[i]);
|
||||||
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
|
drw_setscheme(drw, scheme[m->tagset[m->seltags] & 1 << i ? SchemeSel : SchemeNorm]);
|
||||||
drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
|
drw_text(drw, x, 0, w, bh, lrpad / 2, tags[i], urg & 1 << i);
|
||||||
if (occ & 1 << i)
|
if (occ & 1 << i && m == selmon &&
|
||||||
drw_rect(drw, x + boxs, boxs, boxw, boxw,
|
selmon->sel && selmon->sel->tags[metaws] & 1 << i)
|
||||||
m == selmon && selmon->sel && selmon->sel->tags[metaws] & 1 << i,
|
drw_rect(drw, x + boxs, boxs, boxw, boxw, 1, urg & 1 << i);
|
||||||
urg & 1 << i);
|
|
||||||
x += w;
|
x += w;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue