Skip to content

Commit cc40353

Browse files
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 <noreply@anthropic.com>
1 parent 2e9e2c8 commit cc40353

3 files changed

Lines changed: 3 additions & 1 deletion

File tree

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -669,7 +669,7 @@ install(FILES DSView/icons/logo.svg DESTINATION share/icons/hicolor/scalable/app
669669
install(FILES DSView/icons/logo.svg DESTINATION share/pixmaps RENAME dsview.svg)
670670

671671
if(CMAKE_SYSTEM_NAME MATCHES "Linux")
672-
install(FILES DSView/DSView.desktop DESTINATION /usr/share/applications RENAME dsview.desktop)
672+
install(FILES DSView/DSView.desktop DESTINATION share/applications RENAME dsview.desktop)
673673

674674
add_compile_definitions(_DEFAULT_SOURCE)
675675

DSView/DSView.desktop

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,5 +6,6 @@ Comment=GUI Program for DreamSourceLab USB-based Instruments
66
TryExec=DSView
77
Exec=DSView
88
Icon=dsview
9+
StartupWMClass=DSView
910
Terminal=false
1011
Categories=Development;Electronics;Qt;

DSView/main.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ bool bHighScale = true;
174174
QApplication::setApplicationName("DSView");
175175
QApplication::setOrganizationName("DreamSourceLab");
176176
QApplication::setOrganizationDomain("www.DreamSourceLab.com");
177+
QApplication::setDesktopFileName("dsview");
177178

178179
//----------------------init log
179180
dsv_log_init(); // Don't call before QApplication be inited

0 commit comments

Comments
 (0)