From 60f31cd1bf3a070feb816e3b1952179948743f62 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Tue, 21 Apr 2026 09:13:27 +0800 Subject: [PATCH] opt: dont apply viewback dispatch when no tag change --- src/mango.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/mango.c b/src/mango.c index 8fdff709..b9c77759 100644 --- a/src/mango.c +++ b/src/mango.c @@ -6317,10 +6317,14 @@ void view_in_mon(const Arg *arg, bool want_animation, Monitor *m, } if (arg->ui == UINT32_MAX) { - m->pertag->prevtag = get_tags_first_tag_num(m->tagset[m->seltags]); - m->seltags ^= 1; /* toggle sel tagset */ - m->pertag->curtag = get_tags_first_tag_num(m->tagset[m->seltags]); - goto toggleseltags; + if (m->tagset[0] != m->tagset[1]) { + m->pertag->prevtag = get_tags_first_tag_num(m->tagset[m->seltags]); + m->seltags ^= 1; /* toggle sel tagset */ + m->pertag->curtag = get_tags_first_tag_num(m->tagset[m->seltags]); + goto toggleseltags; + } else { + return; + } } if ((m->tagset[m->seltags] & arg->ui & TAGMASK) != 0) {