diff options
| author | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-08-27 16:32:26 +1000 |
|---|---|---|
| committer | 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> | 2025-08-27 16:32:26 +1000 |
| commit | 93a779ffbd7a31f6a30d9aa235cd9abb37cdbdc2 (patch) | |
| tree | 474e463d531231bda8ef14fd577a7bbc11fa05b4 /modules/areapicker/Picker.qml | |
| parent | picker: use saveItem (diff) | |
| download | caelestia-shell-93a779ffbd7a31f6a30d9aa235cd9abb37cdbdc2.tar.gz caelestia-shell-93a779ffbd7a31f6a30d9aa235cd9abb37cdbdc2.tar.bz2 caelestia-shell-93a779ffbd7a31f6a30d9aa235cd9abb37cdbdc2.zip | |
picker: better client detection
Diffstat (limited to 'modules/areapicker/Picker.qml')
| -rw-r--r-- | modules/areapicker/Picker.qml | 23 |
1 files changed, 13 insertions, 10 deletions
diff --git a/modules/areapicker/Picker.qml b/modules/areapicker/Picker.qml index 999e5c4..14b70b7 100644 --- a/modules/areapicker/Picker.qml +++ b/modules/areapicker/Picker.qml @@ -38,8 +38,14 @@ MouseArea { property real sh: Math.abs(sy - ey) property list<var> clients: { - const ws = Hypr.activeToplevel?.workspace?.id ?? Hypr.activeWsId; - return Hypr.toplevels.values.filter(c => c.workspace?.id === ws).sort((a, b) => { + const mon = Hypr.monitorFor(screen); + if (!mon) + return []; + + const special = mon.lastIpcObject.specialWorkspace; + const wsId = special.name ? special.id : mon.activeWorkspace.id; + + return Hypr.toplevels.values.filter(c => c.workspace?.id === wsId).sort((a, b) => { // Pinned first, then fullscreen, then floating, then any other const ac = a.lastIpcObject; const bc = b.lastIpcObject; @@ -49,6 +55,9 @@ MouseArea { function checkClientRects(x: real, y: real): void { for (const client of clients) { + if (!client) + continue; + let { at: [cx, cy], size: [cw, ch] @@ -72,6 +81,8 @@ MouseArea { closeAnim.start(); } + onClientsChanged: checkClientRects(mouseX, mouseY) + anchors.fill: parent opacity: 0 hoverEnabled: true @@ -175,14 +186,6 @@ MouseArea { } } - Connections { - target: Hypr - - function onActiveWsIdChanged(): void { - root.checkClientRects(root.mouseX, root.mouseY); - } - } - Process { running: true command: ["hyprctl", "-j", "getoption", "general:border_size"] |