Send remote file URIs as local FUSE URIs
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). Xdg-desktop-portal-kde does this too, but xdg-desktop-portal-gnome doesn't.
Also, xdg-desktop-portal not only doesn't recognize any URI type other than file://, but this behavior has been "set in stone" in the xdg-desktop-portal documentation, so it is mandatory for the backends to translate any non-file:// URI into a file:// one using FUSE.
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.
This patch has been merged in upstream and also has been backported to GNOME 45.
Fix LP:#1971168