From 1cb626acddd232e833e7fb75affbef4eea85d1f6 Mon Sep 17 00:00:00 2001 From: DreamMaoMao <2523610504@qq.com> Date: Sat, 9 May 2026 16:38:17 +0800 Subject: [PATCH] opt closet window find --- src/mango.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/mango.c b/src/mango.c index 3bd0c7af..17b99dca 100644 --- a/src/mango.c +++ b/src/mango.c @@ -2086,6 +2086,13 @@ Client *find_closest_tiled_client(Client *c) { if (tc == c || !ISTILED(tc) || !VISIBLEON(tc, c->mon)) continue; + if (cursor->x >= tc->geom.x && + cursor->x < tc->geom.x + tc->geom.width && + cursor->y >= tc->geom.y && + cursor->y < tc->geom.y + tc->geom.height) { + return tc; + } + int32_t dx = tc->geom.x + (int32_t)(tc->geom.width / 2) - cursor->x; int32_t dy = tc->geom.y + (int32_t)(tc->geom.height / 2) - cursor->y; long dist = (long)dx * dx + (long)dy * dy;