diff options
| author | bakkeby <[email protected]> | 2020-07-02 10:09:24 +0200 |
|---|---|---|
| committer | bakkeby <[email protected]> | 2020-07-02 10:09:24 +0200 |
| commit | 188f2f482fba12de02658f5e127fcd5a9a1f0971 (patch) | |
| tree | 67f12c6d74f6786408a263263052fa900a7f1119 | |
| parent | 8120e0b858b9666987ebe68ae6d1011e6dda204d (diff) | |
| download | dwm-flexipatch-188f2f482fba12de02658f5e127fcd5a9a1f0971.tar.gz dwm-flexipatch-188f2f482fba12de02658f5e127fcd5a9a1f0971.zip | |
switchtag patch: do not switch tags if the tag is already shown, same with focusonnetactive patch
| -rw-r--r-- | dwm.c | 20 |
1 files changed, 13 insertions, 7 deletions
@@ -668,8 +668,9 @@ applyrules(Client *c) else newtagset = c->tags; - if (newtagset) { - c->switchtag = selmon->tagset[selmon->seltags]; + /* Switch to the client's tag, but only if that tag is not already shown */ + if (newtagset && !(newtagset & c->mon->tagset[c->mon->seltags])) { + c->switchtag = c->mon->tagset[c->mon->seltags]; c->mon->tagset[c->mon->seltags] = newtagset; if (r->switchtag == 1) #if PERTAG_PATCH @@ -1167,13 +1168,18 @@ clientmessage(XEvent *e) } } else if (cme->message_type == netatom[NetActiveWindow]) { #if FOCUSONNETACTIVE_PATCH - for (i = 0; i < LENGTH(tags) && !((1 << i) & c->tags); i++); - if (i < LENGTH(tags)) { - const Arg a = {.ui = 1 << i}; + if (c->tags & c->mon->tagset[c->mon->seltags]) { selmon = c->mon; - view(&a); 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 if (c != selmon->sel && !c->isurgent) |
