xdg-open does not use default handler

Bug #1894615 reported by Linus Kardell
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
snapd
Expired
Undecided
Unassigned

Bug Description

I'm on OpenSUSE Leap 15.2 KDE, and if xdg-open with a directory (e.g. xdg-open ~) in a snap it opens the directory in Visual Studio Code, whereas if I run the same on the host, the directory is correctly opened in Dolphin. Presumably, this is related to this: https://github.com/microsoft/vscode/issues/41037, where it looks like the system takes the first entry, rather than the default entry.

Revision history for this message
Maciej Borzecki (maciek-borzecki) wrote :

When you run xdg-open inside a snap, it will try to check whether a portal is available and direct a request there.

Can you double check that the output of `xdg-mime query default inode/directory` lists dolphin desktop file? On top of that, can you check that xdg-desktop-portal is running?

Changed in snapd:
status: New → Incomplete
Revision history for this message
Linus Kardell (linagkar) wrote :

linus@raven:~> snap run --shell slack
linus@raven:~> xdg-mime query default inode/directory
org.kde.dolphin.desktop
linus@raven:~> cat /usr/share/applications/mimeinfo.cache | grep inode/directory
inode/directory=code.desktop;org.kde.gwenview.desktop;org.kde.dolphinsu.desktop;org.kde.dolphin.desktop;kfmclient_dir.desktop;org.kde.cervisia.desktop;
linus@raven:~> exit
linus@raven:~> systemctl --user status xdg-desktop-portal
● xdg-desktop-portal.service - Portal service
   Loaded: loaded (/usr/lib/systemd/user/xdg-desktop-portal.service; static; vendor preset: disabled)
   Active: active (running) since Mon 2020-09-14 10:15:07 CEST; 4 days ago
 Main PID: 11828 (xdg-desktop-por)
   CGroup: /user.slice/user-1146.slice/user@1146.service/xdg-desktop-portal.service
           └─11828 /usr/lib/xdg-desktop-portal

sep 14 10:15:07 raven systemd[8591]: Starting Portal service...
sep 14 10:15:07 raven systemd[8591]: Started Portal service.
sep 14 10:15:37 raven xdg-desktop-por[11828]: Failed to get application states: GDBus.Error:org.freedesktop.portal.Error.Failed: Could not get window list
sep 18 10:57:48 raven xdg-desktop-portal[11828]: Warning: 'sandbox' is not in the list of known options, but still passed to Electron/Chromium.

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for snapd because there has been no activity for 60 days.]

Changed in snapd:
status: Incomplete → Expired
Revision history for this message
Linus Kardell (linagkar) wrote :

Should I have removed the incomplete mark from this? The problem is still around.

Changed in snapd:
status: Expired → New
Revision history for this message
Maciej Borzecki (maciek-borzecki) wrote :

This looks like a problem with xdg-desktop-portal:

sep 14 10:15:37 raven xdg-desktop-por[11828]: Failed to get application states: GDBus.Error:org.freedesktop.portal.Error.Failed: Could not get window list
sep 18 10:57:48 raven xdg-desktop-portal[11828]: Warning: 'sandbox' is not in the list of known options, but still passed to Electron/Chromium.

I would suggest trying to open a bug on opensuse bugzilla, might be something with xdg-desktop-portal actually.

Changed in snapd:
status: New → Incomplete
Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for snapd because there has been no activity for 60 days.]

Changed in snapd:
status: Incomplete → Expired
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.