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:
Akash
2026-02-01 10:54:40 +05:30
parent f8903da663
commit 4fbd238a90
@@ -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