From 3b3d10f730082ce22d8bfcfb52611a4ffd2f3c1e Mon Sep 17 00:00:00 2001 From: bbedward Date: Tue, 24 Feb 2026 11:11:38 -0500 Subject: [PATCH] widgets: fix moddedAppID consistency --- .../Modules/DankBar/Widgets/AppsDock.qml | 11 ++-- .../Modules/DankBar/Widgets/RunningApps.qml | 56 +++++++++---------- .../DankBar/Widgets/WorkspaceSwitcher.qml | 10 ++-- 3 files changed, 37 insertions(+), 40 deletions(-) diff --git a/quickshell/Modules/DankBar/Widgets/AppsDock.qml b/quickshell/Modules/DankBar/Widgets/AppsDock.qml index 8ea5ccdd..9e242965 100644 --- a/quickshell/Modules/DankBar/Widgets/AppsDock.qml +++ b/quickshell/Modules/DankBar/Widgets/AppsDock.qml @@ -584,8 +584,7 @@ BasePill { property string tooltipText: { root._desktopEntriesUpdateTrigger; - const moddedId = Paths.moddedAppId(appId); - const desktopEntry = moddedId ? DesktopEntries.heuristicLookup(moddedId) : null; + const desktopEntry = appId ? DesktopEntries.heuristicLookup(appId) : null; const appName = appId ? Paths.getAppName(appId, desktopEntry) : "Unknown"; if (modelData.type === "grouped" && windowCount > 1) { @@ -690,9 +689,8 @@ BasePill { if (!appItem.appId) return ""; if (modelData.isCoreApp) - return ""; // Explicitly skip if core app to avoid flickering or wrong look ups - const moddedId = Paths.moddedAppId(appItem.appId); - const desktopEntry = DesktopEntries.heuristicLookup(moddedId); + return ""; + const desktopEntry = DesktopEntries.heuristicLookup(appItem.appId); return Paths.getAppIcon(appItem.appId, desktopEntry); } smooth: true @@ -749,8 +747,7 @@ BasePill { root._desktopEntriesUpdateTrigger; if (!appItem.appId) return "?"; - const moddedId = Paths.moddedAppId(appItem.appId); - const desktopEntry = DesktopEntries.heuristicLookup(moddedId); + const desktopEntry = DesktopEntries.heuristicLookup(appItem.appId); const appName = Paths.getAppName(appItem.appId, desktopEntry); return appName.charAt(0).toUpperCase(); } diff --git a/quickshell/Modules/DankBar/Widgets/RunningApps.qml b/quickshell/Modules/DankBar/Widgets/RunningApps.qml index 118fa88d..f389e753 100644 --- a/quickshell/Modules/DankBar/Widgets/RunningApps.qml +++ b/quickshell/Modules/DankBar/Widgets/RunningApps.qml @@ -241,14 +241,17 @@ BasePill { property var toplevelData: isGrouped ? (modelData.windows.length > 0 ? modelData.windows[0].toplevel : null) : modelData property bool isFocused: isGrouped ? (root.focusedAppId === appId) : (toplevelData ? toplevelData.activated : false) property string appId: isGrouped ? modelData.appId : (modelData.appId || "") + readonly property string effectiveAppId: { + root._appIdSubstitutionsTrigger; + return Paths.moddedAppId(appId); + } property string windowTitle: toplevelData ? (toplevelData.title || "(Unnamed)") : "(Unnamed)" property var toplevelObject: toplevelData property int windowCount: isGrouped ? modelData.windows.length : 1 property string tooltipText: { root._desktopEntriesUpdateTrigger; - const moddedId = Paths.moddedAppId(appId); - const desktopEntry = moddedId ? DesktopEntries.heuristicLookup(moddedId) : null; - const appName = appId ? Paths.getAppName(appId, desktopEntry) : "Unknown"; + const desktopEntry = effectiveAppId ? DesktopEntries.heuristicLookup(effectiveAppId) : null; + const appName = effectiveAppId ? Paths.getAppName(effectiveAppId, desktopEntry) : "Unknown"; if (isGrouped && windowCount > 1) { return appName + " (" + windowCount + " windows)"; @@ -284,11 +287,10 @@ BasePill { source: { root._desktopEntriesUpdateTrigger; root._appIdSubstitutionsTrigger; - if (!appId) + if (!effectiveAppId) return ""; - const moddedId = Paths.moddedAppId(appId); - const desktopEntry = DesktopEntries.heuristicLookup(moddedId); - return Paths.getAppIcon(appId, desktopEntry); + const desktopEntry = DesktopEntries.heuristicLookup(effectiveAppId); + return Paths.getAppIcon(effectiveAppId, desktopEntry); } smooth: true mipmap: true @@ -311,20 +313,18 @@ BasePill { size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale) name: "sports_esports" color: Theme.widgetTextColor - visible: !iconImg.visible && Paths.isSteamApp(appId) + visible: !iconImg.visible && Paths.isSteamApp(effectiveAppId) } Text { anchors.centerIn: parent - visible: !iconImg.visible && !Paths.isSteamApp(appId) + visible: !iconImg.visible && !Paths.isSteamApp(effectiveAppId) text: { root._desktopEntriesUpdateTrigger; - if (!appId) + if (!effectiveAppId) return "?"; - - const moddedId = Paths.moddedAppId(appId); - const desktopEntry = DesktopEntries.heuristicLookup(moddedId); - const appName = Paths.getAppName(appId, desktopEntry); + const desktopEntry = DesktopEntries.heuristicLookup(effectiveAppId); + const appName = Paths.getAppName(effectiveAppId, desktopEntry); return appName.charAt(0).toUpperCase(); } font.pixelSize: 10 @@ -496,14 +496,17 @@ BasePill { property var toplevelData: isGrouped ? (modelData.windows.length > 0 ? modelData.windows[0].toplevel : null) : modelData property bool isFocused: isGrouped ? (root.focusedAppId === appId) : (toplevelData ? toplevelData.activated : false) property string appId: isGrouped ? modelData.appId : (modelData.appId || "") + readonly property string effectiveAppId: { + root._appIdSubstitutionsTrigger; + return Paths.moddedAppId(appId); + } property string windowTitle: toplevelData ? (toplevelData.title || "(Unnamed)") : "(Unnamed)" property var toplevelObject: toplevelData property int windowCount: isGrouped ? modelData.windows.length : 1 property string tooltipText: { root._desktopEntriesUpdateTrigger; - const moddedId = Paths.moddedAppId(appId); - const desktopEntry = moddedId ? DesktopEntries.heuristicLookup(moddedId) : null; - const appName = appId ? Paths.getAppName(appId, desktopEntry) : "Unknown"; + const desktopEntry = effectiveAppId ? DesktopEntries.heuristicLookup(effectiveAppId) : null; + const appName = effectiveAppId ? Paths.getAppName(effectiveAppId, desktopEntry) : "Unknown"; if (isGrouped && windowCount > 1) { return appName + " (" + windowCount + " windows)"; @@ -538,11 +541,10 @@ BasePill { source: { root._desktopEntriesUpdateTrigger; root._appIdSubstitutionsTrigger; - if (!appId) + if (!effectiveAppId) return ""; - const moddedId = Paths.moddedAppId(appId); - const desktopEntry = DesktopEntries.heuristicLookup(moddedId); - return Paths.getAppIcon(appId, desktopEntry); + const desktopEntry = DesktopEntries.heuristicLookup(effectiveAppId); + return Paths.getAppIcon(effectiveAppId, desktopEntry); } smooth: true mipmap: true @@ -565,20 +567,18 @@ BasePill { size: Theme.barIconSize(root.barThickness, undefined, root.barConfig?.maximizeWidgetIcons, root.barConfig?.iconScale) name: "sports_esports" color: Theme.widgetTextColor - visible: !iconImg.visible && Paths.isSteamApp(appId) + visible: !iconImg.visible && Paths.isSteamApp(effectiveAppId) } Text { anchors.centerIn: parent - visible: !iconImg.visible && !Paths.isSteamApp(appId) + visible: !iconImg.visible && !Paths.isSteamApp(effectiveAppId) text: { root._desktopEntriesUpdateTrigger; - if (!appId) + if (!effectiveAppId) return "?"; - - const moddedId = Paths.moddedAppId(appId); - const desktopEntry = DesktopEntries.heuristicLookup(moddedId); - const appName = Paths.getAppName(appId, desktopEntry); + const desktopEntry = DesktopEntries.heuristicLookup(effectiveAppId); + const appName = Paths.getAppName(effectiveAppId, desktopEntry); return appName.charAt(0).toUpperCase(); } font.pixelSize: 10 diff --git a/quickshell/Modules/DankBar/Widgets/WorkspaceSwitcher.qml b/quickshell/Modules/DankBar/Widgets/WorkspaceSwitcher.qml index 28e48557..02094b79 100644 --- a/quickshell/Modules/DankBar/Widgets/WorkspaceSwitcher.qml +++ b/quickshell/Modules/DankBar/Widgets/WorkspaceSwitcher.qml @@ -282,15 +282,15 @@ Item { } const keyBase = (w.app_id || w.appId || w.class || w.windowClass || "unknown"); - const key = isActiveWs || !SettingsData.groupWorkspaceApps ? `${keyBase}_${i}` : keyBase; + const moddedId = Paths.moddedAppId(keyBase); + const key = isActiveWs || !SettingsData.groupWorkspaceApps ? `${moddedId}_${i}` : moddedId; if (!byApp[key]) { const isQuickshell = keyBase === "org.quickshell"; - const isSteamApp = Paths.isSteamApp(keyBase); - const moddedId = Paths.moddedAppId(keyBase); + const isSteamApp = Paths.isSteamApp(moddedId); const desktopEntry = DesktopEntries.heuristicLookup(moddedId); - const icon = Paths.getAppIcon(keyBase, desktopEntry); - const appName = Paths.getAppName(keyBase, desktopEntry); + const icon = Paths.getAppIcon(moddedId, desktopEntry); + const appName = Paths.getAppName(moddedId, desktopEntry); byApp[key] = { "type": "icon", "icon": icon,