When some custom .desktop file sets StartupWMClass for its application and also sets an icon file for it, Task Switcher isn't picking up that association and on Wayland for example is using a generic Wayland icon. I tested it with Breeze and Cover Switch task switchers, both demonstrated this problem. In comparison, Task Manager does read it correctly and sets the icon properly accordingly, so something isn't done right with task switchers in particular.
Here is how you can test it. Create test.sh file like this: (let's say you place it in your $HOME/tmp/test.sh). #!/bin/bash kdialog --msgbox "Test!" Then create a test.desktop (in $HOME file like this, assuming your user is named foobar and assuming this icon is present on your system: /usr/share/icons/breeze/status/64/dialog-error.svg): [Desktop Entry] Encoding=UTF-8 Value=1.0 Type=Application Name=Test 1 GenericName=Test 1 Comment=Test 1 Icon=/usr/share/icons/breeze/status/64/dialog-error.svg StartupWMClass=org.kde.kdialog Exec="/home/foobar/tmp/test.sh" Then run kbuildsycoca5 to update your launchers and icons cache. Start Test 1 from the launcher (like with krunner or etc.) and observe that Error icon is displayed in Task Manager, but not in Task Switcher.
I meant you should create test.desktop in $HOME/.local/share/applications
A possibly relevant merge request was started @ https://invent.kde.org/utilities/kdialog/-/merge_requests/15
StartupWMClass is a X11 concept, so for Wayland-native windows ignoring it is kind of expected. For Wayland windows we expect what they pass to set_app_id to match the name of their desktop file. If that's not the case then the app needs to be fixed
The task manager has some heuristics to fix up misbehaving apps that the window switcher doesn't have. Unifying that could make sense, but if apps did the right thing by themselves it wouldn't be needed at all
Making it dependent on the application only removes the ability to set custom icons which otherwise are possible with StartupWMClass. So I think flexibility of that is valuable.
The fixup heuristics should probably be shared between the Task Manager and the tabbox, yeah. I agree that in an ideal world apps would always do the right thing, but... well... you know. :)
Git commit d6b62a7fe914ae153dde4a374e57a6c854e288cd by Nicolas Fella. Committed on 13/11/2022 at 17:01. Pushed by nicolasfella into branch 'master'. Add desktop file This is needed to get a window/taskbar icon on Wayland NoDisplay since we don't want it to show up in launchers M +2 -0 src/CMakeLists.txt A +6 -0 src/org.kde.kdialog.desktop https://invent.kde.org/utilities/kdialog/commit/d6b62a7fe914ae153dde4a374e57a6c854e288cd
Just FYI, this still happens with 5.27.3. Didn't test 5.27.4 since it's not in Debian yet.
*** This bug has been marked as a duplicate of bug 459735 ***