Don't count windows that are on all tags when showing icons for tags

This commit is contained in:
Przemek Grondek 2023-03-05 02:46:55 +01:00
parent dd46203749
commit f8656ec0f2
2 changed files with 5 additions and 2 deletions

View File

@ -63,6 +63,7 @@ static const Rule rules[] = {
{"jetbrains-pycharm", NULL, NULL, 0, 0, 0, 0, 1, 1, -1}, {"jetbrains-pycharm", NULL, NULL, 0, 0, 0, 0, 1, 1, -1},
{"jetbrains-idea", NULL, "Welcome to IntelliJ IDEA", 0, 1, 0, 0, 1, 0, -1}, {"jetbrains-idea", NULL, "Welcome to IntelliJ IDEA", 0, 1, 0, 0, 1, 0, -1},
{"firefox", NULL, NULL, 0, 0, 1, 0, 0, 0, -1}, {"firefox", NULL, NULL, 0, 0, 1, 0, 0, 0, -1},
{"firefox", NULL, "Picture-in-Picture", DWM_ALL_TAGS, 1, 0, 0, 0, 0, -1},
}; };
/* layout(s) */ /* layout(s) */

6
dwm.c
View File

@ -76,6 +76,8 @@
#define VERSION_MINOR 0 #define VERSION_MINOR 0
#define XEMBED_EMBEDDED_VERSION (VERSION_MAJOR << 16) | VERSION_MINOR #define XEMBED_EMBEDDED_VERSION (VERSION_MAJOR << 16) | VERSION_MINOR
#define DWM_ALL_TAGS 0x1FF
/* enums */ /* enums */
enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */ enum { CurNormal, CurResize, CurMove, CurLast }; /* cursor */
enum { SchemeNorm, SchemeSel }; /* color schemes */ enum { SchemeNorm, SchemeSel }; /* color schemes */
@ -552,7 +554,7 @@ buttonpress(XEvent *e)
if (ev->window == selmon->barwin) { if (ev->window == selmon->barwin) {
i = x = 0; i = x = 0;
for (c = m->clients; c; c = c->next) for (c = m->clients; c; c = c->next)
occ |= c->tags == 255 ? 0 : c->tags; occ |= c->tags == DWM_ALL_TAGS ? 0 : c->tags;
do { do {
/* do not reserve space for vacant tags */ /* do not reserve space for vacant tags */
if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i)) if (!(occ & 1 << i || m->tagset[m->seltags] & 1 << i))
@ -907,7 +909,7 @@ drawbar(Monitor *m)
resizebarwin(m); resizebarwin(m);
for (c = m->clients; c; c = c->next) { for (c = m->clients; c; c = c->next) {
occ |= c->tags == 255 ? 0 : c->tags; occ |= c->tags == DWM_ALL_TAGS ? 0 : c->tags;
if (c->isurgent) if (c->isurgent)
urg |= c->tags; urg |= c->tags;
} }