From 2f713d3b27fbab60539a492977ae805fa60340f9 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Mon, 7 Jul 2025 23:17:42 +0800 Subject: [PATCH] opt: not apply tagmon when dirtomon is null --- src/maomao.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/maomao.c b/src/maomao.c index 09d9acd..08c986f 100644 --- a/src/maomao.c +++ b/src/maomao.c @@ -5700,12 +5700,16 @@ void tagmon(const Arg *arg) { if (!c) return; + m = dirtomon(arg->i); + + if (!m) + return; + unsigned int newtags = arg->ui ? c->tags : 0; unsigned int target; if (c == selmon->sel) { selmon->sel = NULL; } - m = dirtomon(arg->i); setmon(c, m, newtags, true); client_update_oldmonname_record(c, m);