From 8ba5c83f7bb6c3fe7e8254d6d69fa84020be43cd Mon Sep 17 00:00:00 2001 From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com> Date: Sat, 28 Jun 2025 20:43:48 +1000 Subject: picker: sort client rects Pinned > floating > others --- modules/areapicker/Picker.qml | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) (limited to 'modules') diff --git a/modules/areapicker/Picker.qml b/modules/areapicker/Picker.qml index ad587a8..312c403 100644 --- a/modules/areapicker/Picker.qml +++ b/modules/areapicker/Picker.qml @@ -36,7 +36,14 @@ MouseArea { property real sw: Math.abs(sx - ex) property real sh: Math.abs(sy - ey) - property list clients: Hyprland.toplevels.values.filter(c => c.workspace.id === Hyprland.activeWsId) + property list clients: Hyprland.toplevels.values.filter(c => c.workspace.id === Hyprland.activeWsId).sort((a, b) => { + // Pinned first, then floating, then any other + if (a.lastIpcObject.pinned === b.lastIpcObject.pinned) + return a.lastIpcObject.floating === b.lastIpcObject.floating ? 0 : a.lastIpcObject.floating ? -1 : 1; + if (a.lastIpcObject.pinned) + return -1; + return 1; + }) function checkClientRects(x: real, y: real): void { for (const client of clients) { -- cgit v1.2.3-freya