Open maehne opened 3 weeks ago
Also related: The importance of window to desktop file mapping
W.r.t. the desktop file having the wrong casing: Qt has a plugin for XCB which defaults to the executable name if the desktop filename is empty (qt/qtbase:src/plugins/platforms/xcb/qxcbwindow.cpp#L396).
There is no such plugin for Wayland, maybe it has similar behaviour. What happens if you change the name?
@Vekhir: Thanks for your feedback! Regarding your question:
What happens if you change the name?
I don't fully understand, what name you want me to change for testing? Only if I change the desktop file name to org.oe-f.openboard.desktop
, the application gets assigned the right icons in a Wayland session. Otherwise, the generic Wayland icon gets used. Other variations of the casing don't fix the issue. Note that this might be specific for platforms with case-sensitive file systems. Windows and macOS have case-insensitive file systems by default.
@maehne
what name you want me to change for testing?
The binary name in /usr/bin/
, e.g. /usr/bin/openboard
-> /usr/bin/openboard2
, and then see if the app_id changes accordingly when you run it.
IMO, Qt should default to the application name if set (which itself defaults to binary name) for the .desktop file, but it seems that it just directly jumps to binary name. This test would confirm this, though the (currently best) fix would be to use setDesktopFileName
as you noted.
@Vekhir: Thanks for the clarification! Indeed, renaming /usr/bin/openboard
to /usr/bin/openboard2
causes that the Wayland default icons get assigned to the application with QT_QPA_PLATFORM=wayland
. The correct icons are used for QT_QPA_PLATFORM=xcb
. Therefore, the desktop file name should be explicitly set using QGuiApplication::setDesktopFileName(const QString &name).
Describe the bug
When launching OpenBoard on KDE Plasma in a Wayland, its icon from the .desktop file gets replaced by the default Wayland icon
To Reproduce
$HOME/.local/share/OpenBoard/OpenBoardUser.config
Expected behavior
OpenBoard's icon should be correctly associated to all its windows in the task bar, task switcher, window icon, etc.
Actual behavior
The default Wayland icon is used.
Screenshots
Additional resources
This is a common problem, as can be seen from this reddit discussion. The suggested fix of editing the desktop file to add a
StartupWMClass=
field is a workaround for X11 and only fixes the issue for the taskbar, but not the window icons. However, the correct fix according KDE Bug 460403 needs to be done by the application. It needs to set the app_id so that it matches the desktop file name. Currently, the .desktop file is calledch.openboard.OpenBoard.desktop
, but the app_id is reported asorg.oe-f.openboard
. Changing the name of the .desktop file helps:The source code contains still a number of references to that not anymore existing
oe-f.org
domain:IMHO, the better way to fix this issue is to change all these references to
openboard.ch
. However, the app_id will then still bech.openboard.openboard
. To get the app_id to use mixed case for the last part,QGuiApplication::setDesktopFileName(const QString &name)
should be used, see, e.g., the discussion in QTBUG-77182 and https://github.com/bit-team/backintime/issues/1244.Context
systematic
1.7.0
1.7.1
1.6.4
Linux
in a KDE Plasma Wayland sessionWindows
,macOS
Additional context