Skip to content

fix(tray): advertise IconName only when the theme resolves it; 0.1.2 - #44

Merged
emir-hasanbegovic merged 1 commit into
mainfrom
fix/tray-icon-name-fallback
Aug 24, 2026
Merged

fix(tray): advertise IconName only when the theme resolves it; 0.1.2#44
emir-hasanbegovic merged 1 commit into
mainfrom
fix/tray-icon-name-fallback

Conversation

@emir-hasanbegovic

@emir-hasanbegovic emir-hasanbegovic commented Aug 24, 2026

Copy link
Copy Markdown
Contributor

Problem

On a machine where Dish's hicolor icons are not installed (a source build, the AppImage), the tray item in GNOME's top bar renders as the AppIndicator extension's "..." missing-icon placeholder instead of the app icon.

The StatusNotifierItem always advertised IconName=com.tinkernorth.Dish, and SNI hosts prefer IconName over IconPixmap — so when the theme lookup fails, the shipped pixmap fallback is never consulted and the host draws its placeholder (see gnome-shell-extension-appindicator#232).

Fix

  • IconName (and the tooltip's icon name) is advertised only when QIcon::hasThemeIcon resolves it; otherwise it is empty, which makes hosts fall back to IconPixmap.
  • IconPixmap now carries the brand mark pre-rasterised at the two published sizes (22 and 48 px, rendered from packaging/dish.svg with Qt's own SVG renderer) and compiled into dish_core via resources/tray.qrc, with Q_INIT_RESOURCE anchoring the archive member for static-library consumers. This replaces both the hand-drawn stand-in glyph and the runtime QIcon rasterisation — so the pixmaps no longer depend on an installed theme, the Qt SVG plugin, or runtime painting, and the 22px slot no longer receives 44px frames from device-pixel-ratio scaling.
  • The tooltip carries the same pixmap list as the item, per the SNI tooltip contract.
  • The icon helpers (sniIconName, sniTrayPixmaps, toSniPixmap) live in src/source/tray/SniIcon.{h,cpp}, reachable from the test suite.

Deleting the runtime painting also keeps the TSan leg clean by construction: PNG decoding spawns none of the Qt raster worker threads that QPainter does, so no sanitizer suppression is needed.

Verification

  • New tests in tests/test_tray_icon_fallback.cpp: name suppression both ways, the bundled pixmaps decoding at exactly 22/48 with visible ink and transparency (which also proves the resource registers from the static library in any consumer binary), network-byte-order ARGB encoding of IconPixmap, and item/tooltip consistency before a theme probe.
  • Full local CI parity (scripts/ci_local.sh): clang-format, action-pin lint, Debug and Release suites 1773/1773, qmllint, QML literal scanner, translations sync, full clang-tidy sweep, hardening flags — all green. ASan+UBSan suite 1773/1773; TSan suite green on everything CI runs (the only local failures are pre-existing thread-leak flakes against the machine's real keyring and Qt 6.9, in tests CI skips or passes).
  • End-to-end on GNOME (Wayland, app not installed): the registered item reports IconName='' and IconPixmap frames of exactly 22×22 and 48×48 carrying the brand mark, so the top bar shows the Dish logo instead of "...". An installed build still resolves the themed icon and behaves as before.

🤖 Generated with Claude Code

@emir-hasanbegovic
emir-hasanbegovic force-pushed the fix/tray-icon-name-fallback branch from 1ec0e37 to 2ebc47a Compare August 24, 2026 13:32
StatusNotifier hosts prefer IconName over IconPixmap, so a run without
the hicolor icons installed (a source build, the AppImage) rendered
GNOME's "..." missing-icon placeholder in the top bar even though
fallback pixmaps were shipped. The item now advertises the reverse-DNS
name only when the theme lookup succeeds, and IconPixmap carries the
brand mark pre-rasterised at the two published sizes and compiled into
dish_core, replacing both the hand-drawn stand-in glyph and the
runtime QIcon rasterisation (whose device-pixel-ratio scaling shipped
44px frames for the 22px slot). The tooltip carries the same icon
fields.

Ships as 0.1.2 (CMakeLists, changelog, metainfo entry). Follow-up: tag
0.1.2 on the merge commit.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@emir-hasanbegovic emir-hasanbegovic changed the title fix(tray): advertise IconName only when the theme resolves it fix(tray): advertise IconName only when the theme resolves it; 0.1.2 Aug 24, 2026
@emir-hasanbegovic
emir-hasanbegovic force-pushed the fix/tray-icon-name-fallback branch from 2ebc47a to 9f522a0 Compare August 24, 2026 13:42
@emir-hasanbegovic
emir-hasanbegovic merged commit 4b86573 into main Aug 24, 2026
13 checks passed
@emir-hasanbegovic
emir-hasanbegovic deleted the fix/tray-icon-name-fallback branch August 24, 2026 14:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant