Bug 476601 - default wayland W icon shown when custom .desktop file used for chromium
Summary: default wayland W icon shown when custom .desktop file used for chromium
Status: RESOLVED NOT A BUG
Alias: None
Product: kwin
Classification: Plasma
Component: wayland-generic (show other bugs)
Version: 5.27.9
Platform: Arch Linux Linux
: NOR normal
Target Milestone: ---
Assignee: KWin default assignee
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-11-05 19:48 UTC by andy
Modified: 2023-11-05 21:19 UTC (History)
1 user (show)

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


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description andy 2023-11-05 19:48:54 UTC
SUMMARY

In a plasma wayland session, if chromium is configured with wayland settings (--enable-features=WaylandWindowDecorations --ozone-platform-hint=auto) then the icon shown in the titlebar and task manager  is the yellow "W" circle, the default wayland icon, regardless of the icon in specified in a custom desktop file.

I have multiple chromium profiles and I create a desktop file for each in ~/.local/share/applications/. Each desktop file gets their own icon, and specifies --user-data-dir in the cmdline. 

The icon works as expected in these other scenarios:  
- In a plasma x11 session, the icons work as expected. 
- In a plasma wayland session, the icons work as expected if chromium is running with xwayland. 



STEPS TO REPRODUCE

1. Create a desktop file for "Chromium-Extra". 
- create a folder for the profile in ~/chromium_profiles/extra
- create an icon for the profile in ~/chromium_profiles/_icons/Chromium_Logo-green.svg
- create the desktop file  ~/.local/share/applications/chromium-extra.desktop with the following contents:
```
[Desktop Entry]
Version=1.0
Name=Chromium-Extra
GenericName=Web Browser
Exec=/usr/bin/chromium --class=Chromium-Extra --user-data-dir=/home/xxxx/chromium_profiles/extra %U
StartupNotify=true
Terminal=false
#Icon=chromium
Icon=/home/xxxx/chromium_profiles/_icons/Chromium_Logo-green.svg
Type=Application
Categories=Network;WebBrowser;
MimeType=application/pdf;application/rdf+xml;application/rss+xml;application/xhtml+xml;application/xhtml_xml;application/xml;image/gif;image/jpeg;image/png;image/webp;text/html;text/xml;x-scheme-handler/http;x-scheme-handler/https;
Actions=new-window;new-private-window;

[Desktop Action new-window]
Name=New Window
Exec=/usr/bin/chromium --class=Chromium-Extra --user-data-dir=/home/xxxx/chromium_profiles/extra

[Desktop Action new-private-window]
Name=New Incognito Window
```

2. Set ~/.config/chromium-flags.conf to
```
--enable-features=WaylandWindowDecorations
--ozone-platform-hint=auto
```

3. From the application menu, launch Chromium-Extra

OBSERVED RESULT

- the application menu shows Chromium-Extra with a custom icon
- when it is launched, there is a brief ~1 second window where the taskbar shows an item titled "Chromium-Extra" with the custom icon, alongside additional windows (from the previous session) which have the yellow W icon.
- the "Chromium-Extra" in the tasbkar with the correct icon disappears after ~1 second, and the other windows remain with the yellow W icon
- the windows are correctly grouped together in the taskbar, separate from other chromium instances

EXPECTED RESULT
- all windows launched from Chromium-Extra have the custom icon, not the yellow W icon

SOFTWARE/OS VERSIONS
Linux/KDE Plasma: 
KDE Plasma Version: 5.27.9
KDE Frameworks Version: 5.111.0
Qt Version:  5.15.11

ADDITIONAL INFORMATION

If I use the debug console (qdbus org.kde.KWin /KWin org.kde.KWin.showDebugConsole), and inspect one of the windows, it shows the desktopFileName as "chromium (/home/xxx/chromium_profiles/extra)". I'm unsure why it isn't "Chromium-Extra". The icon field is blank, but it seems blank for every other application that has an icon too.
Comment 1 andy 2023-11-05 20:05:59 UTC
OK so if I change the "Name=" line in the desktop file
 from "Name=Chromium-Extra"
 to "Name=chromium (/home/andy/chromium_profiles/extra)"

then the icon is as expected.

Question is if this is a kwin/plasma bug, or a something else. Is it chromium defining it's own "Name" as a function of the profile location, so there is only one option for the desktop file name?

Also I remember the "--class=Chromium-Extra" argument I was clearly using for this to work on the x11-side.
Comment 2 David Edmundson 2023-11-05 21:19:05 UTC
There's not much we can do.

The app reports it's app ID and the spec says this must match the desktop file name. If it doesn't match we show the "W".

>Also I remember the "--class=Chromium-Extra" argument I was clearly using for this to work on the x11-side.
Chromium should hook this up for their wayland session.

You can debug what they are sending currently with

WAYLAND_DEBUG=1 chromium |& grep app_id