From cc40353007053654200acccdfbecaadba08b8cdc Mon Sep 17 00:00:00 2001 From: Michael Sharman Date: Sun, 12 Apr 2026 21:01:24 +1000 Subject: [PATCH] Fix DSView icon missing from COSMIC desktop taskbar On Wayland (e.g. COSMIC), running apps are matched to their desktop entry via the Wayland app-id. Qt derives the app-id from QGuiApplication::desktopFileName() if set, otherwise falls back to the application name ("DSView"). Since the desktop file is named "dsview.desktop", the case mismatch prevented COSMIC from matching the running app to its entry. Fixed by calling setDesktopFileName("dsview") to explicitly match the desktop file name. Also moved the desktop file install destination from the hardcoded /usr/share/applications to the cmake install prefix (share/applications) for consistency with other installed files. Added StartupWMClass=DSView for X11 compatibility. Co-Authored-By: Claude Sonnet 4.6 --- CMakeLists.txt | 2 +- DSView/DSView.desktop | 1 + DSView/main.cpp | 1 + 3 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CMakeLists.txt b/CMakeLists.txt index cc82669f0..c2572ac7e 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -669,7 +669,7 @@ install(FILES DSView/icons/logo.svg DESTINATION share/icons/hicolor/scalable/app install(FILES DSView/icons/logo.svg DESTINATION share/pixmaps RENAME dsview.svg) if(CMAKE_SYSTEM_NAME MATCHES "Linux") - install(FILES DSView/DSView.desktop DESTINATION /usr/share/applications RENAME dsview.desktop) + install(FILES DSView/DSView.desktop DESTINATION share/applications RENAME dsview.desktop) add_compile_definitions(_DEFAULT_SOURCE) diff --git a/DSView/DSView.desktop b/DSView/DSView.desktop index e11432406..399d1a68e 100644 --- a/DSView/DSView.desktop +++ b/DSView/DSView.desktop @@ -6,5 +6,6 @@ Comment=GUI Program for DreamSourceLab USB-based Instruments TryExec=DSView Exec=DSView Icon=dsview +StartupWMClass=DSView Terminal=false Categories=Development;Electronics;Qt; diff --git a/DSView/main.cpp b/DSView/main.cpp index 748a59d95..170377c33 100644 --- a/DSView/main.cpp +++ b/DSView/main.cpp @@ -174,6 +174,7 @@ bool bHighScale = true; QApplication::setApplicationName("DSView"); QApplication::setOrganizationName("DreamSourceLab"); QApplication::setOrganizationDomain("www.DreamSourceLab.com"); + QApplication::setDesktopFileName("dsview"); //----------------------init log dsv_log_init(); // Don't call before QApplication be inited