From 93a779ffbd7a31f6a30d9aa235cd9abb37cdbdc2 Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Wed, 27 Aug 2025 16:32:26 +1000 Subject: picker: better client detection --- modules/areapicker/Picker.qml | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) (limited to 'modules/areapicker') 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 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"] -- cgit v1.2.3-freya