mirror of
https://github.com/DreamMaoMao/maomaowm.git
synced 2026-05-17 21:42:08 -04:00
opt closet window find
This commit is contained in:
parent
4fffa2f03e
commit
1cb626acdd
1 changed files with 7 additions and 0 deletions
|
|
@ -2086,6 +2086,13 @@ Client *find_closest_tiled_client(Client *c) {
|
||||||
if (tc == c || !ISTILED(tc) || !VISIBLEON(tc, c->mon))
|
if (tc == c || !ISTILED(tc) || !VISIBLEON(tc, c->mon))
|
||||||
continue;
|
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 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;
|
int32_t dy = tc->geom.y + (int32_t)(tc->geom.height / 2) - cursor->y;
|
||||||
long dist = (long)dx * dx + (long)dy * dy;
|
long dist = (long)dx * dx + (long)dy * dy;
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue