From 0a0322e18dc5aadb2a56e4b73335e29052a73608 Mon Sep 17 00:00:00 2001 From: vicrodh <103399283+vicrodh@users.noreply.github.com> Date: Fri, 11 Sep 2026 15:30:07 -0600 Subject: [PATCH] fix(linux): publish the desktop-file name so Wayland windows match their launcher GNOME Shell pairs a live window with its launcher through the Wayland app_id, and Qt sends the executable's name (`qbz`) unless the application sets its desktop-file name. Every Linux package installs the entry as `com.blitzfc.qbz.desktop`, so the dock painted the generic icon while the app grid, which reads the .desktop directly, showed the right one; the D-Bus notification `desktop-entry` hint had the same gap. StartupWMClass covers X11 only. Set `QGuiApplication::desktopFileName` to `com.blitzfc.qbz` right after the application exists (Linux only). Verified the mechanism on an Ubuntu GNOME/Wayland VM: a `qbz.desktop` symlink made the dock icon appear. cc --- crates/qbz-qt/src/main.rs | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/crates/qbz-qt/src/main.rs b/crates/qbz-qt/src/main.rs index 51ce28701..48b3942ed 100644 --- a/crates/qbz-qt/src/main.rs +++ b/crates/qbz-qt/src/main.rs @@ -4024,6 +4024,18 @@ fn main() { cxx_qt_lib::QQuickStyle::set_style(&QString::from("Basic")); let mut app = QGuiApplication::new(); + // The Wayland `app_id` (and the D-Bus notification `desktop-entry` hint) + // comes from this, and with nothing set Qt sends the binary's name, `qbz`. + // GNOME Shell matches a live window to its launcher by that id against the + // installed `com.blitzfc.qbz.desktop`, so the dock painted the generic + // icon (and the notification badge attached to nothing) while the app + // grid, which reads the .desktop directly, showed the right one. + // `StartupWMClass` covers X11 only. Verified on an Ubuntu GNOME/Wayland VM + // 2026-09-11: a `qbz.desktop` symlink made the dock icon appear; this is + // the real fix. Every Linux package installs the entry under this id + // (deb/rpm, AUR, Flatpak, Snap). + #[cfg(target_os = "linux")] + QGuiApplication::set_desktop_file_name(&QString::from("com.blitzfc.qbz")); renderer_qt::apply_gpu_preference(); // W25. Windows asks WM_QUERYENDSESSION before it decides to log off or