running favorited snap shows two icons in Ubuntu dock

Bug #1718942 reported by Merlijn Sebrechts
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Snappy
Fix Released
Undecided
Unassigned
gnome-shell-extension-ubuntu-dock (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

Ubuntu 17.10

If you favorite a snap, the icon shows up on the Ubuntu Dock. If you click the icon, the application starts, but it creates a second (lower resolution) icon for the running application.

steps to reproduce:

- install atom from software center
- favorite atom
- run atom

Screenshot: https://pasteboard.co/GLyaJ0V.png

Tags: artful
tags: added: artful
Revision history for this message
John Lenton (chipaca) wrote : Re: [Bug 1718942] Re: running favorited snap shows two icons in Ubuntu dock

I don't know which app you're testing this with, but I suspect it
needs to add a StartupWMClass entry in its .desktop file

On 28 September 2017 at 03:49, Merlijn Sebrechts
<email address hidden> wrote:
> ** Tags added: artful
>
> ** Also affects: gnome-shell-extension-ubuntu-dock (Ubuntu)
> Importance: Undecided
> Status: New
>
> --
> You received this bug notification because you are a member of Snappy
> Developers, which is subscribed to Snappy.
> https://bugs.launchpad.net/bugs/1718942
>
> Title:
> running favorited snap shows two icons in Ubuntu dock
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/snappy/+bug/1718942/+subscriptions

Revision history for this message
Merlijn Sebrechts (merlijn-sebrechts) wrote :

Easy to test with keepassx, both available in software center (keepassx) and as a snap (keepassx-elopio)

I can confirm that setting `StartupWMClass=keepassx-elopio_keepassx` in `/var/lib/snapd/desktop/applications/keepassx-elopio_keepassx.desktop` fixes the issue.

However, the snap's desktop file already includes the `BAMF_DESKTOP_FILE_HINT`: `Exec=env BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/keepassx-elopio_keepassx.desktop /snap/bin/keepassx-elopio.keepassx %U`

Why is this not working? Is BAMF a unity-only thing?

Revision history for this message
John Lenton (chipaca) wrote :

bamfdaemon is a unity thing, i believe

On 28 September 2017 at 08:24, Merlijn Sebrechts
<email address hidden> wrote:
> Easy to test with keepassx, both available in software center (keepassx)
> and as a snap (keepassx-elopio)
>
>
> I can confirm that setting `StartupWMClass=keepassx-elopio_keepassx` in
> `/var/lib/snapd/desktop/applications/keepassx-elopio_keepassx.desktop`
> fixes the issue.
>
> However, the snap's desktop file already includes the
> `BAMF_DESKTOP_FILE_HINT`: `Exec=env
> BAMF_DESKTOP_FILE_HINT=/var/lib/snapd/desktop/applications/keepassx-
> elopio_keepassx.desktop /snap/bin/keepassx-elopio.keepassx %U`
>
> Why is this not working? Is BAMF a unity-only thing?
>
> --
> You received this bug notification because you are a member of Snappy
> Developers, which is subscribed to Snappy.
> https://bugs.launchpad.net/bugs/1718942
>
> Title:
> running favorited snap shows two icons in Ubuntu dock
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/snappy/+bug/1718942/+subscriptions

Revision history for this message
Merlijn Sebrechts (merlijn-sebrechts) wrote :

That makes sense.

I did some digging, `StartupWMClass` is a freedesktop standard [1], so it seems a good DE-agnostic way to fix this issue.

The `BAMF_DESKTOP_FILE_HINT` isn't set by the app developer [2], it's put there by snapd [3]. Thus, the correct place to fix this seems to be that place; add another rewrite rule that adds `StartupWMClass=<appname>` to the desktop file. What do you think of this solution, @chipaca? [you seem the right person to ask this given you wrote the BAMF code ;)].

[1] https://standards.freedesktop.org/desktop-entry-spec/latest/ar01s05.html
[2] https://github.com/keepassxreboot/keepassxc/blob/develop/snap/gui/keepassxc.desktop
[3] https://github.com/snapcore/snapd/blob/f5c93b549692b377343ffb0757e1f6c0efafeb9d/wrappers/desktop.go#L109

Revision history for this message
Jesse (jessedubord) wrote :

I'm also experiencing a similar issue: left-click+dragging an app icons (snap or traditional package) to the Ubuntu dock to favorite it adds two shortcut instances instead of one. Performing this for gedit produces two favorite shortcuts, everytime.

Bug discovered on Ubuntu 17.10 beta 2.

Revision history for this message
John Lenton (chipaca) wrote :

@Merlijn, I don't think there's a way for snapd to know the WMClass of an app in a snap.

Revision history for this message
Merlijn Sebrechts (merlijn-sebrechts) wrote :

I can't reproduce anymore on 17.10, keepassx-elopio is now associated with the correct icon, even though the StartupWMClass in their desktop file is still incorrect.

Changed in snappy:
status: New → Fix Released
Changed in gnome-shell-extension-ubuntu-dock (Ubuntu):
status: New → Fix Released
Revision history for this message
Merlijn Sebrechts (merlijn-sebrechts) wrote :

@jesse: Your bug is a different one, please open a new bug report for that one.

Revision history for this message
Merlijn Sebrechts (merlijn-sebrechts) wrote :
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.