From 3137156162d4911d32e862170d81165169d3eeda Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Mon, 5 Jan 2026 22:08:44 +0800 Subject: [PATCH] opt: optimize sloppyfocus --- src/mango.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mango.c b/src/mango.c index ed42412..67909f3 100644 --- a/src/mango.c +++ b/src/mango.c @@ -4112,8 +4112,10 @@ void pointerfocus(Client *c, struct wlr_surface *surface, double sx, double sy, uint32_t time) { struct timespec now; - if (surface != seat->pointer_state.focused_surface && sloppyfocus && time && - c && c->scene->node.enabled && !client_is_unmanaged(c)) + if (sloppyfocus && c && time && c->scene->node.enabled && + (surface != seat->pointer_state.focused_surface || + (selmon && selmon->sel && c != selmon->sel)) && + !client_is_unmanaged(c)) focusclient(c, 0); /* If surface is NULL, clear pointer focus */