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.

** Changed in: chromium-browser (Ubuntu)
     Assignee: (unassigned) => Olivier Tilloy (osomon)

** Changed in: chromium-browser (Ubuntu)
   Importance: Undecided => Medium

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to chromium-browser in Ubuntu.
https://bugs.launchpad.net/bugs/1750243

Title:
  [snap] StartupWMClass missing in .desktop file

Status in chromium-browser package in Ubuntu:
  Confirmed

Bug description:
  Chromium Snap Version 64.0.3282.167

  How to reproduce:

  In Gnome:

  Add the Chromium Snap to the left launcher panel. 
  Start the Chromium Snap.

  Actual behavior: 
  The Chromium snap starts and creates a new symbol in the launcher panel.

  Desired behavior:
  The Chromium snap should start using the symbol which is already pinned to 
the launcher panel.

  In Budgie:

  The Chromium Snap cannot be pinned to the panel at all.

  Possible solution:

  Add StartupWMClass= ... to the .desktop launcher of the chromium snap.

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/chromium-browser/+bug/1750243/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to