From f0b2cba787704d2ff4ef687c1f01d5f1a5c00386 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Fri, 29 Aug 2025 18:49:01 +0800 Subject: [PATCH] opt: fix tagsel toggle --- src/mango.c | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/mango.c b/src/mango.c index f388dd0..9bca953 100644 --- a/src/mango.c +++ b/src/mango.c @@ -5021,7 +5021,7 @@ void toggleoverview(const Arg *arg) { visible_client_number++; } if (visible_client_number > 0) { - target = ~0; + target = ~0 & TAGMASK; } else { selmon->isoverview ^= 1; return; @@ -5356,23 +5356,32 @@ void view_in_mon(const Arg *arg, bool want_animation, Monitor *m, bool changefocus) { unsigned int i, tmptag; - if (!m || (arg->ui != ~0 && m->isoverview)) { + if (!m || (arg->ui != (~0 & TAGMASK) && m->isoverview)) { return; } - if (arg->ui == 0) + if (arg->ui == 0) { return; + } + + if (arg->ui == UINT32_MAX) { + m->pertag->prevtag = m->tagset[m->seltags]; + m->seltags ^= 1; /* toggle sel tagset */ + m->pertag->curtag = m->tagset[m->seltags]; + goto toggleseltags; + } if ((m->tagset[m->seltags] & arg->ui & TAGMASK) != 0) { want_animation = false; } m->seltags ^= 1; /* toggle sel tagset */ + if (arg->ui & TAGMASK) { m->tagset[m->seltags] = arg->ui & TAGMASK; tmptag = m->pertag->curtag; - if (arg->ui == ~0) + if (arg->ui == (~0 & TAGMASK)) m->pertag->curtag = 0; else { for (i = 0; !(arg->ui & 1 << i) && i < LENGTH(tags) && arg->ui != 0;