diff --git a/Modules/Bar/Widgets/ActiveWindow.qml b/Modules/Bar/Widgets/ActiveWindow.qml index e55086e..5291991 100644 --- a/Modules/Bar/Widgets/ActiveWindow.qml +++ b/Modules/Bar/Widgets/ActiveWindow.qml @@ -48,14 +48,18 @@ RowLayout { // Try CompositorService first const focusedWindow = CompositorService.getFocusedWindow() if (focusedWindow && focusedWindow.appId) { - return Icons.iconForAppId(focusedWindow.appId.toLowerCase()) + const idValue = focusedWindow.appId + const normalizedId = (typeof idValue === 'string') ? idValue : String(idValue) + return Icons.iconForAppId(normalizedId.toLowerCase()) } // Fallback to ToplevelManager if (ToplevelManager && ToplevelManager.activeToplevel) { const activeToplevel = ToplevelManager.activeToplevel if (activeToplevel.appId) { - return Icons.iconForAppId(activeToplevel.appId.toLowerCase()) + const idValue2 = activeToplevel.appId + const normalizedId2 = (typeof idValue2 === 'string') ? idValue2 : String(idValue2) + return Icons.iconForAppId(normalizedId2.toLowerCase()) } } diff --git a/Services/CompositorService.qml b/Services/CompositorService.qml index 173d3d6..3a5545f 100644 --- a/Services/CompositorService.qml +++ b/Services/CompositorService.qml @@ -192,9 +192,9 @@ Singleton { } windowsList.push({ - "id": toplevel.address || "", - "title": toplevel.title || "", - "appId": appId, + "id": (toplevel.address !== undefined && toplevel.address !== null) ? String(toplevel.address) : "", + "title": (toplevel.title !== undefined && toplevel.title !== null) ? String(toplevel.title) : "", + "appId": (appId !== undefined && appId !== null) ? String(appId) : "", "workspaceId": toplevel.workspace?.id || null, "isFocused": toplevel.activated === true })