Skip to content

Fix app icon missing from taskbar on Wayland (e.g. COSMIC)#903

Open
TheCodeSharman wants to merge 1 commit intoDreamSourceLab:masterfrom
TheCodeSharman:fix-cosmic-icon
Open

Fix app icon missing from taskbar on Wayland (e.g. COSMIC)#903
TheCodeSharman wants to merge 1 commit intoDreamSourceLab:masterfrom
TheCodeSharman:fix-cosmic-icon

Conversation

@TheCodeSharman
Copy link
Copy Markdown

Summary

  • Call QApplication::setDesktopFileName("dsview") so the Wayland app-id matches the desktop entry basename, allowing compositors (e.g. COSMIC) to correctly associate the running app with its icon
  • Add StartupWMClass=DSView to the desktop file for equivalent X11 window manager matching
  • Move the desktop file cmake install destination from the hardcoded /usr/share/applications to the install-prefix-relative share/applications, consistent with all other installed files

Background

On Wayland, compositors match running apps to their .desktop entry using the app-id. Qt derives the app-id from QGuiApplication::desktopFileName(), falling back to the application name ("DSView") if not set. Since the desktop file is named dsview.desktop, the case mismatch caused the icon to appear in the app launcher (search) but not in the taskbar for running apps.

Test plan

  • Launch DSView on a Wayland compositor (e.g. COSMIC) — icon should appear in the taskbar when running
  • Icon appears in the app launcher/search
  • Launch DSView via XWayland — icon still matches correctly

🤖 Generated with Claude Code

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>
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