From 293e5251e82deb567d7d98e69659a63efce9782a Mon Sep 17 00:00:00 2001 From: John Goh Date: Fri, 21 Aug 2026 00:05:50 +0800 Subject: [PATCH] fix: match GTK desktop window class --- packaging/linux/chartr.desktop | 2 +- scripts/smoke-appimage.sh | 13 ++++++------- 2 files changed, 7 insertions(+), 8 deletions(-) diff --git a/packaging/linux/chartr.desktop b/packaging/linux/chartr.desktop index 91bf3d8c..de5de36d 100644 --- a/packaging/linux/chartr.desktop +++ b/packaging/linux/chartr.desktop @@ -11,5 +11,5 @@ Keywords=agent;terminal;multiplexer;wayfinder; # The window's WM_CLASS, so the desktop pairs the running window with this entry # rather than drawing a second, iconless task-bar item beside it. GTK derives it # from the program name, which is `chartr` inside the AppDir. -StartupWMClass=chartr +StartupWMClass=Chartr StartupNotify=true diff --git a/scripts/smoke-appimage.sh b/scripts/smoke-appimage.sh index b6878375..78af0408 100755 --- a/scripts/smoke-appimage.sh +++ b/scripts/smoke-appimage.sh @@ -85,17 +85,16 @@ docker run --rm -v "$(realpath "$APPIMAGE")":/chartr.AppImage:ro "$IMAGE" bash - fail "WebKit reported an internal error" fi - # The X11 identity and icon are the runtime half of desktop integration. - # Merely finding chartr.png inside the AppImage would not prove either was - # attached to the actual GTK window (the original regression). + # The X11 identity is the runtime half of desktop integration. GTK's resource + # name is lowercase and its resource class is conventionally title-cased; + # StartupWMClass uses the latter so a real desktop resolves the bundled icon. + # Bare Xvfb has no window manager, so _NET_WM_ICON is diagnostic only here. WINDOW_ID=$(xdotool search --onlyvisible --name "chartr" 2>/dev/null | head -n 1) [ -n "$WINDOW_ID" ] || fail "could not find the chartr window" PROPS=$(xprop -id "$WINDOW_ID" WM_CLASS _NET_WM_ICON) echo "$PROPS" - echo "$PROPS" | grep -q "WM_CLASS(STRING) = \"chartr\", \"chartr\"" || \ + echo "$PROPS" | grep -q "WM_CLASS(STRING) = \"chartr\", \"Chartr\"" || \ fail "the window WM_CLASS does not match chartr.desktop" - echo "$PROPS" | grep -q "_NET_WM_ICON(CARDINAL) =" || \ - fail "the GTK window has no application icon" - echo "SMOKE PASSED: the cockpit rendered and its window carries the chartr icon" + echo "SMOKE PASSED: the cockpit rendered and its window matches chartr.desktop" '