summaryrefslogtreecommitdiff
path: root/modules
diff options
context:
space:
mode:
Diffstat (limited to 'modules')
-rw-r--r--modules/areapicker/Picker.qml23
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"]