[snap] Deleting the ~/snaps folder breaks Gnome dash window tracking for chromium

Bug #1892146 reported by Aljoscha Vollmerhaus on 2020-08-19
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
chromium-browser (Ubuntu)
Undecided
Unassigned

Bug Description

Deleting the ~/snaps folder in ubuntu seems to permanently break gnome dash window tracking.

Steps to reproduce:

1) Add chromium-browser.desktop to your dash / dock favourites. Chromium Windows get attributed to this favourite when created.

2) Delete the ~/snaps folder, quit all chromium processes and / or reboot

3) The ~/snaps folder gets recreated, but Chromium windows now get attributed to a new chromium-browser dash icon, ignoring the favourite created in step 1

I know I know, don't delete the ~/snaps folder then!

Unfortunately, there are situations when this is beyond my control.
These desktops are gonna get into the hands of normal users, like my dad and my colleagues.
They will delete the folder by accident or because they don't know and don't care about snaps.
Deleting it shouldn't permanently break window tracking.

This is on a fully patched 20.04 system.

description: updated
Olivier Tilloy (osomon) wrote :

Indeed, deleting the ~/snap folder isn't a reasonable use case, it will break much more than just window tracking (for starters it will remove your entire chromium profile, including bookmarks and navigation history, which you most likely don't want).

That said, I can't seem to reproduce the bug. After deleting the ~/snap folder and restarting chromium, the window is mapped to the launcher icon as expected.

What is the output of the following command on your system?

    gsettings get org.gnome.shell favorite-apps

Changed in chromium-browser (Ubuntu):
status: New → Incomplete
tags: added: snap

I'm still able to reproduce it.
Interestingly, the new Chromium window now displays a "file not found" error for file:///snap/chromium/1275/firstrun/snap-en.html when launched.

$ gsettings get org.gnome.shell favorite-apps
['thunderbird.desktop', 'libreoffice-writer.desktop', 'libreoffice-calc.desktop', 'org.gnome.Nautilus.desktop', 'chromium-browser.desktop', 'org.gnome.Screenshot.desktop', 'org.gnome.Calculator.desktop']

Olivier Tilloy (osomon) wrote :

> Interestingly, the new Chromium window now displays a "file not found"
> error for file:///snap/chromium/1275/firstrun/snap-en.html when launched.

Oh, good catch, this is an (unrelated) regression, fixed with https://git.launchpad.net/~chromium-team/chromium-browser/+git/snap-from-source/commit/?id=0959d5f44d9ce6dbcac4b89228e7014e9b07e95f.

Olivier Tilloy (osomon) wrote :

Ok, so the issue with the launcher is that your favourite for Chromium is 'chromium-browser.desktop', whereas it should be 'chromium_chromium.desktop'.

If you have the chromium-browser deb package installed, running /usr/bin/chromium-browser (just once) should translate the desktop file name. If not, you can modify its value by hand with this command:

    gsettings set org.gnome.shell favorite-apps "['thunderbird.desktop', 'libreoffice-writer.desktop', 'libreoffice-calc.desktop', 'org.gnome.Nautilus.desktop', 'chromium_chromium.desktop', 'org.gnome.Screenshot.desktop', 'org.gnome.Calculator.desktop']"

Please let us know if that fixes the problem for you.

Hi,

sorry for taking so long to respond.

Setting the favourite to "chromium_chromium.desktop" instead of "chromium-browser.desktop" does indeed seem to work! Thanks!

Is the chromium_chromium.desktop file generated when chromium is installed or when it is first started by the user?
Because I'm provisioning the dconf values through ansible, it would be a bit of a pain to have to run chromium first just to have the chromium_chromium.desktop file available.

Olivier Tilloy (osomon) wrote :

chromium_chromium.desktop is created by snapd (in /var/lib/snapd/desktop/applications/) when installing the snap.

Olivier Tilloy (osomon) wrote :

Thank you for following up, I'm now closing the bug.

Changed in chromium-browser (Ubuntu):
status: Incomplete → Invalid
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers