mirror of
https://github.com/AvengeMedia/DankMaterialShell.git
synced 2026-01-28 15:32:50 -05:00
hypr: prevent events with bad data
This commit is contained in:
@@ -108,7 +108,6 @@ Singleton {
|
|||||||
Connections {
|
Connections {
|
||||||
target: Hyprland.toplevels
|
target: Hyprland.toplevels
|
||||||
function onValuesChanged() {
|
function onValuesChanged() {
|
||||||
root._hasRefreshedOnce = false
|
|
||||||
root.scheduleSort()
|
root.scheduleSort()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -166,7 +165,7 @@ Singleton {
|
|||||||
|
|
||||||
function sortHyprlandToplevelsSafe() {
|
function sortHyprlandToplevelsSafe() {
|
||||||
if (!Hyprland.toplevels || !Hyprland.toplevels.values) return []
|
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)
|
const items = Array.from(Hyprland.toplevels.values)
|
||||||
|
|
||||||
@@ -198,6 +197,8 @@ Singleton {
|
|||||||
if (!t) continue
|
if (!t) continue
|
||||||
|
|
||||||
const addr = t.address || ""
|
const addr = t.address || ""
|
||||||
|
if (!addr) continue
|
||||||
|
|
||||||
const li = t.lastIpcObject || null
|
const li = t.lastIpcObject || null
|
||||||
|
|
||||||
const monName = _get(li, ["monitor"], null) ?? _get(t, ["monitor", "name"], "")
|
const monName = _get(li, ["monitor"], null) ?? _get(t, ["monitor", "name"], "")
|
||||||
@@ -241,8 +242,7 @@ Singleton {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
if (missingAnyPosition && hasNewWindow) {
|
if (missingAnyPosition && hasNewWindow && !_hasRefreshedOnce) {
|
||||||
_hasRefreshedOnce = false
|
|
||||||
scheduleRefresh()
|
scheduleRefresh()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user