From 392a1c03c53ce916ec8d2ba61e852d34d2e1b9cb Mon Sep 17 00:00:00 2001 From: bbedward Date: Sun, 9 Nov 2025 11:11:08 -0500 Subject: [PATCH] hypr: prevent events with bad data --- Services/CompositorService.qml | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/Services/CompositorService.qml b/Services/CompositorService.qml index ddec1de9..793ae3e8 100644 --- a/Services/CompositorService.qml +++ b/Services/CompositorService.qml @@ -108,7 +108,6 @@ Singleton { Connections { target: Hyprland.toplevels function onValuesChanged() { - root._hasRefreshedOnce = false root.scheduleSort() } } @@ -166,7 +165,7 @@ Singleton { function sortHyprlandToplevelsSafe() { if (!Hyprland.toplevels || !Hyprland.toplevels.values) return [] - if (_refreshScheduled) return sortedToplevelsCache + if (_refreshScheduled && sortedToplevelsCache.length > 0) return sortedToplevelsCache const items = Array.from(Hyprland.toplevels.values) @@ -198,6 +197,8 @@ Singleton { if (!t) continue const addr = t.address || "" + if (!addr) continue + const li = t.lastIpcObject || null const monName = _get(li, ["monitor"], null) ?? _get(t, ["monitor", "name"], "") @@ -241,8 +242,7 @@ Singleton { }) } - if (missingAnyPosition && hasNewWindow) { - _hasRefreshedOnce = false + if (missingAnyPosition && hasNewWindow && !_hasRefreshedOnce) { scheduleRefresh() }