Bug 447845 - Under Wayland, XWayland web apps have incorrect icon
Summary: Under Wayland, XWayland web apps have incorrect icon
Alias: None
Product: plasmashell
Classification: Plasma
Component: Task Manager and Icons-Only Task Manager (show other bugs)
Version: 5.23.4
Platform: Kubuntu Linux
: NOR normal
Target Milestone: 1.0
Assignee: Eike Hein
: 454600 (view as bug list)
Depends on:
Reported: 2022-01-02 16:39 UTC by Alan Pope
Modified: 2022-11-11 08:19 UTC (History)
8 users (show)

See Also:
Latest Commit:
Version Fixed In: 5.25

screenshot showing incorrect icon (248.35 KB, image/png)
2022-01-02 16:39 UTC, Alan Pope

Note You need to log in before you can comment on or make changes to this bug.
Description Alan Pope 2022-01-02 16:39:57 UTC
Created attachment 145057 [details]
screenshot showing incorrect icon


"Web apps" in this context are shortcuts to websites, created as desktop files in .local/share/applications by the web browser. These are created to enable "alt-tabbing" between web sites, and having icons in the "Icons-Only Task Manager" to make access to those sites quick and easy. I'm using Microsoft Edge as the browser, and what I explained below works on X11, but not on Wayland.

1. Install / Open Microsoft Edge
2. Visit a website that has an icon such as Tweetdeck or BBC news (site selection doesn't really matter, but needs a favicon)
3. In Edge click Kebab -> Apps -> Install this site as an app
4. Enter a description, then click "Install" button


Under wayland - not working :
- A window opens, detached from the browser, with the website chosen inside it.
- ALT-TAB shows the 'favicon' for the site in the switcher
- The Icons-Only Task Manager does _not_ show the right icon. Instead, you see a second icon for the browser.

In the attached screenshot, you'll see bottom left, that I am hovering over the second Microsoft Edge icon, which should be a Tweetdeck icon, and from the preview you can (just about) see the web content is the Tweetdeck site. 


Under X11 - working :
- A window opens, detached from the browser, with the website chosen inside it.
- ALT-TAB shows the 'favicon' for the site in the switcher
- The Icons-Only Task Manager shows the correct icon for the additional application.

Linux/KDE Plasma: Kubuntu 21.10 + Kubuntu Backports PPA
KDE Plasma Version: 5.23.4
KDE Frameworks Version: 5.89.0
Qt Version: 5.15.2

Comment 1 Nicolas Fella 2022-01-03 15:56:16 UTC
The problem is that on X11 we use the windowClassName to map the window to the .desktop file, which works.
On Wayland we (mainly) use the applicationId for that, which only really works for native Wayland windows, not XWayland windows like Edge.

What we probably need to do is expose the windowClassName for XWayland windows in the Plasma<->KWin communication and use that in the task manager
Comment 2 Nicolas Fella 2022-01-12 16:47:41 UTC
https://chromium-review.googlesource.com/c/chromium/src/+/3383817 might fix that, unless Edge has a custom codepath for that
Comment 3 Nate Graham 2022-01-12 17:19:06 UTC

*** This bug has been marked as a duplicate of bug 358277 ***
Comment 4 Bug Janitor Service 2022-01-23 20:06:44 UTC
A possibly relevant merge request was started @ https://invent.kde.org/plasma/plasma-workspace/-/merge_requests/1396
Comment 5 Nicolas Fella 2022-04-14 11:20:37 UTC
Git commit 7b94f03c0f5fec052454a1c8d6faec0aff2ce0cb by Nicolas Fella.
Committed on 14/04/2022 at 11:14.
Pushed by nicolasfella into branch 'master'.

[libtaskmanager] Consider resource name for XWayland windows

Like we do in an X11 session
Related: bug 358277

M  +1    -1    libtaskmanager/waylandtasksmodel.cpp

Comment 6 Nicolas Fella 2022-05-30 12:50:15 UTC
*** Bug 454600 has been marked as a duplicate of this bug. ***
Comment 7 tnizametdinov 2022-11-10 09:34:16 UTC
I'm on Plasma 5.25.5, but the issue is still there.
Comment 8 Nate Graham 2022-11-10 14:58:04 UTC
Apps can still be at fault even with this fix; any cases you still encounter are the app not setting their icons properly.
Comment 9 tnizametdinov 2022-11-11 08:17:55 UTC
The app mentioned (Chromium) is not regular but a platform - the gate to other apps - PWAs. The correctly displayed icon of a running PWA is crucial - it allows one to distinguish the app from a regular browser tab in a desktop environment.

IMHO PWAs are _crucial_ for the Linux ecosystem and KDE in particular. They open a door for applications that don't have desktop Linux implementations. Web Apps are now very advanced - they completely replace native Windows apps (say, MS Outlook PWA version in some aspects is more advanced than MS Outlook Windows app, ).

Therefore, even if some issue in Chromium causes the issue, the Linux community may be even more interested in a fix than Chromium itself.

Therefore, there should be collaboration, and this particular problem should be treated as a special case.

I'm not sure it's related to the app, BTW - the PWA icon in the start menu and taskbar is displayed correctly. The problem is that there are no special icons displayed for a *running* app.
Comment 10 tnizametdinov 2022-11-11 08:19:47 UTC
(The app mentioned in closed as a duplicate bug - https://bugs.kde.org/show_bug.cgi?id=454600).