From fc13b0ff15973c66e24ab4a06a31748070af2a51 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Mon, 19 Jan 2026 22:18:05 +0800 Subject: [PATCH] opt: optimize global client focus logic --- src/layout/arrange.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/layout/arrange.h b/src/layout/arrange.h index 7f81e5b..6ff1dd2 100644 --- a/src/layout/arrange.h +++ b/src/layout/arrange.h @@ -692,8 +692,10 @@ arrange(Monitor *m, bool want_animation, bool from_view) { if (c->mon == m && (c->isglobal || c->isunglobal)) { c->tags = m->tagset[m->seltags]; - if (c->mon->sel == NULL) - focusclient(c, 0); + } + + if (from_view && m->sel == NULL && c->isglobal && VISIBLEON(c, m)) { + focusclient(c, 1); } if (VISIBLEON(c, m)) {