picker: fix client selecting
This commit is contained in:
parent
bed6f7c5d5
commit
8689ea423a
1 changed files with 10 additions and 6 deletions
|
|
@ -39,13 +39,17 @@ MouseArea {
|
||||||
property list<var> clients: Hyprland.toplevels.values.filter(c => c.workspace.id === Hyprland.activeWsId)
|
property list<var> clients: Hyprland.toplevels.values.filter(c => c.workspace.id === Hyprland.activeWsId)
|
||||||
|
|
||||||
function checkClientRects(x: real, y: real): void {
|
function checkClientRects(x: real, y: real): void {
|
||||||
for (const c of clients) {
|
for (const client of clients) {
|
||||||
if (c.x <= x && c.y <= y && c.x + c.width >= x && c.y + c.height >= y) {
|
const {
|
||||||
|
at: [cx, cy],
|
||||||
|
size: [cw, ch]
|
||||||
|
} = client.lastIpcObject;
|
||||||
|
if (cx <= x && cy <= y && cx + cw >= x && cy + ch >= y) {
|
||||||
onClient = true;
|
onClient = true;
|
||||||
sx = c.x;
|
sx = cx;
|
||||||
sy = c.y;
|
sy = cy;
|
||||||
ex = c.x + c.width;
|
ex = cx + cw;
|
||||||
ey = c.y + c.height;
|
ey = cy + ch;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue