Fix generic icon when using Wayland #1923
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
When using melonDS on Wayland (Plasma in my case) the program icon was not set correctly such that the generic Wayland icon was used instead of melonDS own icon. The reason for that is that the used method
setWindowIcon
does not work on Wayland anymore for setting app icons. Instead applications should make use ofsetDesktopFileName
which provides the graphical shell the name of the associated desktop file from which the referenced icon is taken for the taskbar and the window border.I've tested the commit on Linux using Plasma on Wayland and Plasma on X11; in either case both icons (window border / window decorations and taskbar) were set correctly.
Regarding the used flags I'm unsure if there exists a better fitting flag (like e.g.
__UNIX__
), but I think it should cover the relevant platforms.What's worth noting is, that despite the icon shouldn't work at all without my commit on Wayland (with Plasma) in the taskbar and the window border, the icon was only broken in the window border and not in the taskbar. Other applications with the same issue (using only
setWindowIcon
) had broken icons in the taskbar and the window border.The newly added method eventually raises the required version of Qt5 to version 5.7 in which the method
setDesktopFileName
was added.