Public bug reported:

This is an issue observed on Ubuntu 24.04.

When creating a custom .desktop file for a snap application (e.g.,
Firefox) with a different StartupWMClass and custom Icon, GNOME Shell
ignores the WM_CLASS match and instead uses the snap's sandboxed app-id
to associate the window with the snap-provided .desktop file. This makes
it impossible for users to create custom launchers for snap apps with
distinct icons.

In my case, I have multiple firefox profiles and use a custom .desktop
file to launch the right profile with the application having the right
custom icon. This works great on all the recent versions of Kubuntu on
Xorg and Wayland. I switched to using vanilla Ubuntu 24.04 recently and
this does not work.

This can be reproduced by creating a custom .desktop file in
~/.local/share/applications with contents similar to

```
[Desktop Entry]
Name=Foo Bar Firefox
Type=Application
Exec=/snap/bin/firefox %u -P foobar --name=foobar                               
                                                                                
                                                           
Icon=/path/to/custom-icon.png
StartupWMClass=foobar
```
saving it as `foobar-firefox.desktop`.

Then you can search for this new .desktop file and launch it. You will
see that it has the vanilla Firefox icon and not the custom icon
specified in the .desktop file.

I examined this with the GNOME looking glass utility and it says that
the application launched this way has `wmclass: foobar` and `app:
firefox_firefox.desktop`. The latter might be a trigger for this
problem.

** Affects: gnome-shell (Ubuntu)
     Importance: Undecided
         Status: New

-- 
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/2146522

Title:
  Custom .desktop files with StartupWMClass cannot override icon for
  snap applications

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/gnome-shell/+bug/2146522/+subscriptions


-- 
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to