Originally created by: kristofferR
set_badge_count is effectively a no-op on GNOME/KDE, so the only Linux unread surface is the tray tooltip. Three complementary pieces (all fed by the existing carrier:unread handling in lib.rs, which already zeroes the count when the unread-badge setting is off):
1. Count badge drawn on the KSNI tray pixmap. New tray_badge.rs (cfg(any(linux, test))), pure-Rust pixel drawing, no new deps: a filled Messenger-red circle bottom-right (~45–50 % of icon width, 4×4 subpixel AA) with digits from an embedded const bitmap font (0-9, +), integer-scaled; shows 1–9 and 9+. Drawn in RGBA before the existing tested rgba_to_argb. Count bucketed (0, 1..9, 9+) so the pixmap is only recomputed on bucket change. LinuxTray gains unread + a cached badged icon; new PlatformTrayIcon::set_unread mirrors set_tooltip. Check default_window_icon() size first — if small, embed icons/128x128.png as the tray base so panels get a high-res pixmap.
2. Status::NeedsAttention when unread > 0 (ksni 0.3 supports status() + attention_icon_pixmap(); return the same badged pixmap to avoid icon-swap flicker). Independent of the badge — if panel highlighting proves noisy it can be dropped alone.
3. Unity LauncherEntry D-Bus badge — honored by KDE's taskbar and Ubuntu Dock/Dash-to-Dock, and works even with the tray disabled. Emit the broadcast signal com.canonical.Unity.LauncherEntry.Update with (app_uri, {"count": i64, "count-visible": bool}) over a lazy session connection (zbus, already in-tree). app_uri = application://Carrier.desktop (verified against the shipped deb), or $FLATPAK_ID.desktop under Flatpak. Emit count-visible: false at startup (clears stale badges) and on exit.
Testing: unit tests for circle coverage, digit rendering (1/9/9+), bucketing, no badge at 0, app-URI selection. Manual: KDE icons-only task manager badge; busctl --user monitor shows the Update signal; toggling the unread-badge setting clears everything.
Part of [#171].
Originally posted by: kristofferR
Implemented and merged in [#195]: unread counts now drive tray badge pixmaps, NeedsAttention, and Unity LauncherEntry progress. Closing as complete.
Related
Tickets:
#195Ticket changed by: kristofferR