From b4dd299c2226e3d635f7f819fc4d25de2ffcfe32 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Sun, 30 Mar 2025 19:52:45 +0800 Subject: [PATCH] opt:optimize border color change when tagmon --- maomao.c | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/maomao.c b/maomao.c index bdb27be..7a2080c 100644 --- a/maomao.c +++ b/maomao.c @@ -5439,13 +5439,12 @@ void tag(const Arg *arg) { void tagmon(const Arg *arg) { Client *c = focustop(selmon); - Client *fc; Monitor *m; if (c) { + if(c == selmon->sel) { + selmon->sel = NULL; + } m = dirtomon(arg->i); - fc = focustop(selmon); - if(!fc) - selmon->sel = c; setmon(c, m, 0); reset_foreign_tolevel(c); // 重新计算居中的坐标 @@ -5455,16 +5454,18 @@ void tagmon(const Arg *arg) { (int)(c->geom.height * c->mon->w.height / selmon->w.height); selmon = c->mon; c->geom = setclient_coordinate_center(c->geom); + focusclient(c, 1); resize(c, c->geom, 1); } else { selmon = c->mon; + focusclient(c, 1); arrange(selmon, false); } warp_cursor_to_selmon(c->mon); - focusclient(c, 1); } } + void overview(Monitor *m, unsigned int gappo, unsigned int gappi) { grid(m, overviewgappo, overviewgappi); }