mirror of
https://github.com/mintycube/dwm.git
synced 2024-10-22 12:05:45 +00:00
switchtag patch: do not switch tags if the tag is already shown, same with focusonnetactive patch
This commit is contained in:
parent
8120e0b858
commit
188f2f482f
20
dwm.c
20
dwm.c
@ -668,8 +668,9 @@ applyrules(Client *c)
|
|||||||
else
|
else
|
||||||
newtagset = c->tags;
|
newtagset = c->tags;
|
||||||
|
|
||||||
if (newtagset) {
|
/* Switch to the client's tag, but only if that tag is not already shown */
|
||||||
c->switchtag = selmon->tagset[selmon->seltags];
|
if (newtagset && !(newtagset & c->mon->tagset[c->mon->seltags])) {
|
||||||
|
c->switchtag = c->mon->tagset[c->mon->seltags];
|
||||||
c->mon->tagset[c->mon->seltags] = newtagset;
|
c->mon->tagset[c->mon->seltags] = newtagset;
|
||||||
if (r->switchtag == 1)
|
if (r->switchtag == 1)
|
||||||
#if PERTAG_PATCH
|
#if PERTAG_PATCH
|
||||||
@ -1167,13 +1168,18 @@ clientmessage(XEvent *e)
|
|||||||
}
|
}
|
||||||
} else if (cme->message_type == netatom[NetActiveWindow]) {
|
} else if (cme->message_type == netatom[NetActiveWindow]) {
|
||||||
#if FOCUSONNETACTIVE_PATCH
|
#if FOCUSONNETACTIVE_PATCH
|
||||||
for (i = 0; i < LENGTH(tags) && !((1 << i) & c->tags); i++);
|
if (c->tags & c->mon->tagset[c->mon->seltags]) {
|
||||||
if (i < LENGTH(tags)) {
|
|
||||||
const Arg a = {.ui = 1 << i};
|
|
||||||
selmon = c->mon;
|
selmon = c->mon;
|
||||||
view(&a);
|
|
||||||
focus(c);
|
focus(c);
|
||||||
restack(selmon);
|
} else {
|
||||||
|
for (i = 0; i < LENGTH(tags) && !((1 << i) & c->tags); i++);
|
||||||
|
if (i < LENGTH(tags)) {
|
||||||
|
const Arg a = {.ui = 1 << i};
|
||||||
|
selmon = c->mon;
|
||||||
|
view(&a);
|
||||||
|
focus(c);
|
||||||
|
restack(selmon);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
#else
|
#else
|
||||||
if (c != selmon->sel && !c->isurgent)
|
if (c != selmon->sel && !c->isurgent)
|
||||||
|
Loading…
x
Reference in New Issue
Block a user