Skip to content

[GNOME 45] Send remote file URIs as local FUSE URIs

Georges Basile Stavracas Neto requested to merge cherry-pick-8acf01a3 into gnome-45

Several people complain that they can't save files in remote drives (like a SMB mount) from containerized applications (like Firefox). After doing several tests, I found that it worked fine when using xdg-desktop-portal-gtk, but not when using xdg-desktop-portal-gnome.

The reason seems to be that xdg-desktop-portal-gtk translates the smb:// URIs (and other remote URIs like sftp://) into locally accessible file:// URIs (thanks to the FUSE backends available with Gvfs), but xdg-desktop-portal-gnome doesn't do that.

This patch fixes this by checking each URI obtained from the GtkFileChooser dialog, and if it isn't a "file://" one, it tries to translate it into its FUSE local URI.

Also ensure that a trash:/// or a recent:/// URI is transformed into a local one.

Fix https://bugzilla.mozilla.org/show_bug.cgi?id=1773624 Fix https://github.com/flatpak/xdg-desktop-portal/issues/213 Fix https://github.com/flatpak/xdg-desktop-portal/issues/820

(cherry picked from commit 8acf01a3)

Merge request reports