From ad6c8dfda5bc492a6f875df851370c3a9ee80120 Mon Sep 17 00:00:00 2001 From: nico Date: Thu, 10 Sep 2026 17:46:56 +0200 Subject: [PATCH] Resolve taskbar icons via Wayland appId instead of Hyprland's IPC class Taskbar icons only resolved for windows already open when Quickshell started - anything opened afterward fell back to the letter placeholder. lastIpcObject (Hyprland's IPC JSON snapshot) apparently lags or stays stale for windows opened after Quickshell is already running. Switched to preferring the Wayland toplevel handle's appId, which the compositor sets immediately on window creation, with lastIpcObject.class kept as a fallback. Fixes the common case (opening a window after Quickshell is running); pre-existing windows at Quickshell startup can still miss their icon due to a startup enumeration race between Quickshell and the Wayland toplevel-management protocol - acceptable since that's not really a real-world scenario. Co-Authored-By: Claude Sonnet 5 Claude-Session: https://claude.ai/code/session_01Dujsk9jYfxUVLtb5B8eC94 --- quickshell/default/Bar.qml | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/quickshell/default/Bar.qml b/quickshell/default/Bar.qml index e68f800..c98369c 100644 --- a/quickshell/default/Bar.qml +++ b/quickshell/default/Bar.qml @@ -405,7 +405,15 @@ Variants { id: taskBtn required property var modelData readonly property bool isActive: bar.activeToplevel !== null && taskBtn.modelData.address === bar.activeToplevel.address - readonly property string wmClass: taskBtn.modelData.lastIpcObject ? (taskBtn.modelData.lastIpcObject.class || "") : "" + // Prefer the Wayland toplevel handle's appId - it's set by the + // compositor immediately on window creation. lastIpcObject + // (Hyprland's IPC JSON snapshot) can lag or stay stale for + // windows opened after Quickshell started, which was leaving + // icons unresolved for anything not already open at launch. + readonly property string wmClass: { + if (taskBtn.modelData.wayland && taskBtn.modelData.wayland.appId) return taskBtn.modelData.wayland.appId + return taskBtn.modelData.lastIpcObject ? (taskBtn.modelData.lastIpcObject.class || "") : "" + } readonly property var desktopEntry: { // heuristicLookup() is a plain call, not a reactive property read; // depend on applications explicitly so this re-evaluates once the