Comment 8 for bug 1750243

Revision history for this message
Olivier Tilloy (osomon) wrote :

I tested again, and while I can confirm that the chromium snap cannot be pinned to the favorite apps in a Fedora 29 VM without the "StartupWMClass=chromium" line in its desktop file, Ubuntu doesn't seem to be affected. I tested bionic and eoan, in the alternative gnome-session, which has defaults similar to Fedora.

I dug a bit in gnome-shell's code to try and understand why it's needed in Fedora and not in Ubuntu in the first place.

In get_app_from_window_wmclass():

  /* first try a match from WM_CLASS (instance part) to StartupWMClass */
  /* then try a match from WM_CLASS to StartupWMClass */
  /* then try a match from WM_CLASS (instance part) to .desktop */
  /* finally, try a match from WM_CLASS to .desktop */

The first two attempts will fail when there's no StartupWMClass.
The last two attempts would try to match, respectively, "chromium" (instance) and "Chromium" (class name) to a desktop file name. I'm not sure by which magic that would match against "chromium_chromium.desktop" (which is the name of the desktop file installed by the snap).

In this light, adding StartupWMClass to the desktop file looks correct, and won't hurt the existing matching logic on desktops where it already works.