1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2025-12-08 06:25:37 -05:00

hypr: prevent events with bad data

This commit is contained in:
bbedward
2025-11-09 11:11:08 -05:00
parent 1524d27f4c
commit 392a1c03c5

View File

@@ -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()
}