picker: sort client rects

Pinned > floating > others
This commit is contained in:
2 * r + 2 * t 2025-06-28 20:43:48 +10:00
parent 4aa4e8eaf9
commit 8ba5c83f7b

View file

@ -36,7 +36,14 @@ MouseArea {
property real sw: Math.abs(sx - ex)
property real sh: Math.abs(sy - ey)
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).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) {