forked from Shinonome/dots-hyprland
fix(dock): add robust retry mechanism for desktop entry lookup
Resolves an issue where dock buttons would fail to function on startup if the system's application database wasn't fully loaded. Adds a self-healing timer to DockAppButton.
This commit is contained in:
@@ -18,7 +18,18 @@ DockButton {
|
||||
property bool appIsActive: appToplevel.toplevels.find(t => (t.activated == true)) !== undefined
|
||||
|
||||
readonly property bool isSeparator: appToplevel.appId === "SEPARATOR"
|
||||
readonly property var desktopEntry: DesktopEntries.heuristicLookup(appToplevel.appId)
|
||||
property var desktopEntry: DesktopEntries.heuristicLookup(appToplevel.appId)
|
||||
|
||||
Timer {
|
||||
// Retry looking up the desktop entry if it failed (e.g. database not loaded yet)
|
||||
interval: 500
|
||||
running: !root.isSeparator && root.desktopEntry === null
|
||||
repeat: true
|
||||
onTriggered: {
|
||||
root.desktopEntry = DesktopEntries.heuristicLookup(root.appToplevel.appId);
|
||||
}
|
||||
}
|
||||
|
||||
enabled: !isSeparator
|
||||
implicitWidth: isSeparator ? 1 : implicitHeight - topInset - bottomInset
|
||||
|
||||
|
||||
Reference in New Issue
Block a user