aboutsummaryrefslogtreecommitdiffstats
path: root/dwm.c
diff options
context:
space:
mode:
authorJoe <bousset.rudy@gmail.com>2022-08-25 16:10:02 +0200
committerJoe <bousset.rudy@gmail.com>2022-08-25 16:10:02 +0200
commit946be76ca726b28883db45136d9b9b39bc8042c1 (patch)
treec891bb6b518e69001e546af20354948dae52d714 /dwm.c
parentbtmstck update (diff)
downloaddwm-946be76ca726b28883db45136d9b9b39bc8042c1.tar.gz
dwm-946be76ca726b28883db45136d9b9b39bc8042c1.tar.bz2
dwm-946be76ca726b28883db45136d9b9b39bc8042c1.tar.xz
dwm-946be76ca726b28883db45136d9b9b39bc8042c1.tar.zst
dwm-946be76ca726b28883db45136d9b9b39bc8042c1.zip
update
Diffstat (limited to '')
-rw-r--r--dwm.c9
1 files changed, 9 insertions, 0 deletions
diff --git a/dwm.c b/dwm.c
index 4bd377b..65e29b7 100644
--- a/dwm.c
+++ b/dwm.c
@@ -2012,6 +2012,15 @@ toggleview(const Arg *arg)
unsigned int newtagset = selmon->tagset[selmon->seltags] ^ (arg->ui & TAGMASK);
int i;
+ // the first visible client should be the same after we add a new tag
+ // we also want to be sure not to mutate the focus
+ Client *const c = nexttiled(selmon->clients);
+ if (c) {
+ Client * const selected = selmon->sel;
+ pop(c);
+ focus(selected);
+ }
+
if (newtagset) {
selmon->tagset[selmon->seltags] = newtagset;