Closed ReillyBrogan closed 11 months ago
Note that I have no experience with cmake or QT, so this solution may not be particularly idiomatic or clean. This should work for Flatpak but I have no idea how to test that.
I tested the following configurations after making this change and all worked as expected:
Lint issues should be fixed now
Note that this also fixes an issue with the native window frame. Before on Plasma it would display the generic Wayland icon in the top left, now it displays the Notes icon. This wasn't an issue on GNOME because GNOME Wayland reads the StartupWMClass property from the .desktop file and uses that to match windows as well (which is technically non-conformant with the Freedesktop/Wayland specs but GNOME devs do whatever they want to do).
You can see this in the screenshots in this comment: https://github.com/nuttyartist/notes/issues/347#issuecomment-1427598576
Awesome! thanks, @ReillyBrogan! Let's wait for @guihkx to test on his end as well before merging (:
Thanks!
Wayland compositors use the desktopFileName window property to associate native Wayland windows with their .desktop launcher.
This was previously set to "notes" when qt launched as a native Wayland window (the default in Wayland sessions), which could cause various inconsistencies.
Notably, KDE Plasma would display the generic Wayland icon in task view for Notes instead of the icon referenced in the .desktop file.
Fix this by propagating the APP_ID property (which is used to name the .desktop file during packaging) to main.cpp so that we can call setDesktopFileName with it.
After this change KDE Plasma correctly displays the Notes icon in task view.
Before:![image](https://github.com/nuttyartist/notes/assets/4309817/6c7b6424-0f67-4da9-8d98-07ba50d80fca)
After:![image](https://github.com/nuttyartist/notes/assets/4309817/68cf9a4a-b2fd-4bb0-9504-4727483eb700)