picker: fix client selecting

This commit is contained in:
2 * r + 2 * t 2025-06-27 21:50:00 +10:00
parent bed6f7c5d5
commit 8689ea423a

View file

@ -39,13 +39,17 @@ MouseArea {
property list<var> clients: Hyprland.toplevels.values.filter(c => c.workspace.id === Hyprland.activeWsId)
function checkClientRects(x: real, y: real): void {
for (const c of clients) {
if (c.x <= x && c.y <= y && c.x + c.width >= x && c.y + c.height >= y) {
for (const client of clients) {
const {
at: [cx, cy],
size: [cw, ch]
} = client.lastIpcObject;
if (cx <= x && cy <= y && cx + cw >= x && cy + ch >= y) {
onClient = true;
sx = c.x;
sy = c.y;
ex = c.x + c.width;
ey = c.y + c.height;
sx = cx;
sy = cy;
ex = cx + cw;
ey = cy + ch;
break;
}
}