Bug 466599 - Window decoration and Alt+Tab menu for Wayland-native app shows generic Wayland icon; Task manager shows correct icon
Summary: Window decoration and Alt+Tab menu for Wayland-native app shows generic Wayla...
Status: REOPENED
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 6.3.3
Platform: Other Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-02-28 14:12 UTC by gus
Modified: 2025-03-27 19:19 UTC (History)
4 users (show)

See Also:
Latest Commit:
Version Fixed In:
Sentry Crash Report:


Attachments
Shows the panel with the proper Slack icon and part of the Slack window with the Wayland generic icon. (54.12 KB, image/png)
2023-02-28 14:12 UTC, gus
Details
Output of "WAYLAND_DEBUG=1 /usr/bin/slack --enable-features=WebRTCPipeWireCapturer --enable-features=UseOzonePlatform --ozone-platform=wayland -s" (70.41 KB, text/plain)
2023-03-02 14:15 UTC, gus
Details

Note You need to log in before you can comment on or make changes to this bug.
Description gus 2023-02-28 14:12:04 UTC
Created attachment 156827 [details]
Shows the panel with the proper Slack icon and part of the Slack window with the Wayland generic icon.

SUMMARY
***
I run my electron apps (e.g., Slack, Signal) with the options `--enable-features=UseOzonePlatform --ozone-platform=wayland`. In that case, the icon shown in the left corner of the window or in the task switcher (Large Icon) is the default Wayland icon. On the other hand, the "Icons-only Task Manager" in my panel shows the proper application icon.

Although the electron app may be partially to blame for not providing an icon properly, presumably the same logic used by the Task Manager could be used by the task switcher and the window manager to find the proper icon rather than using the generic one.
***


STEPS TO REPRODUCE
1. Start slack with `/usr/bin/slack --enable-features=WebRTCPipeWireCapturer --enable-features=UseOzonePlatform --ozone-platform=wayland -s`
2. Use Alt-Tab to switch between apps
3. Look a icon in window vs. icon in task manager

OBSERVED RESULT

The icon in the task switcher or in the window title bar is the default Wayland icon.  The icon in the "Icon-only Task Manager" is the Slack icon.

EXPECTED RESULT

All three icons should be the Slack icon.

SOFTWARE/OS VERSIONS
Windows: 
macOS: 
Linux/KDE Plasma: Arch Linux
(available in About System)
KDE Plasma Version: 5.27.1
KDE Frameworks Version: 5.103.0
Qt Version: 5.15.8

ADDITIONAL INFORMATION
Comment 1 Vlad Zahorodnii 2023-03-02 13:38:08 UTC
Please run slack with WAYLAND_DEBUG=1 environment variable and post the output here.
Comment 2 gus 2023-03-02 14:15:52 UTC
Created attachment 156922 [details]
Output of "WAYLAND_DEBUG=1 /usr/bin/slack --enable-features=WebRTCPipeWireCapturer --enable-features=UseOzonePlatform --ozone-platform=wayland -s"
Comment 3 Fushan Wen 2023-03-05 14:36:26 UTC
Where do you get Slack?
Comment 4 Fushan Wen 2023-03-05 14:39:15 UTC
Please report the bug to Slack (or the package maintainer in AUR) because Slack sets its appid as "Slack" but the desktop filename is "slack.desktop", so kwin can't match them.
Comment 5 gus 2023-03-06 14:37:17 UTC
I get slack from AUR. I will report it to Slack.

Nevertheless, it is strange that not just Slack but also Signal misbehave when using wayland (not when using Xorg), and that kwin doesn't show the proper icon but the task manager widget does.
Comment 6 Damglador 2025-03-27 19:19:59 UTC
Why can the taskbar detect the window icon even without the desktop file matching the WMClass of the app, but KWin can't? This issue is not exclusive to Electron applications, it happens with any other application using Wayland natively. From my testing, if StartupWMClass in desktop file matches the WMClass of the app, taskbar gets the icon, but Alt+Tab menu still shows the Wayland icon.

Is it possible to do in KWin the same what the taskbar does? It's not always possible to match .desktop file name with WMClass. With system packages, packager may be able to add a dummy .desktop for icon or rename the upstream one (if you'll be able to convince them to do so), but with flatpak you wouldn't be able to do so, packager would need to patch the program to have WMClass matching the .desktop file name, or user would need to add their own dummy .desktop file just to make KWin show the proper icon. For example, Zen[1], and I have the same issue with youtube-music, WineWayland apps have to have .desktop files with .exe in their name, when they could just have it in StartupWMClass. 

Additionally, according to this comment[2], GNOME is able to show the proper icon just by having proper WMClass in StartupWMClass, without having to also match the .desktop file name.

Communicating all that to each package maintainer and software developer is problematic, and considering that GNOME and the taskbar already can fetch the proper icon, it would be nice if KWin also could.

[1]: https://www.reddit.com/r/kde/comments/1jl4mme/comment/mk21nd9/
[2]: https://github.com/th-ch/youtube-music/issues/2806#issuecomment-2584973530