valent icon indicating copy to clipboard operation
valent copied to clipboard

"Browse Files" results in "No apps available"

Open tomaszn opened this issue 7 months ago • 5 comments

Current Behavior

On my Xubuntu 23.10, Xfce 4.18, no application is found to open (and mount) the "Browse Files" link.

A GNOME-looking window appears, and says:

No apps available No apps installed that can open "sftp://..."

Valent is installed from Flatpak.

At the same time, opening the link via xdg-open works. Thunar, the default file browser, appears on the screen.

What can be the reason?

Expected Behavior

Thunar opens, and I see files kept on the phone.

Desktop

XFCE

Other Desktop

No response

Operating System

Ubuntu 23.10

Installed from

Nightly Flatpak

Version

nightly

Devices

KDE Connect (Android)

Plugins

Files

Logs

$ /usr/bin/flatpak run --branch=master --arch=x86_64 --command=valent --file-forwarding ca.andyholmes.Valent

(process:2): Gtk-WARNING **: 17:10:36.523: Locale not supported by C library.
	Using the fallback 'C' locale.
17:10:36.6241                       GLib-GIO:    DEBUG: Using cross-namespace EXTERNAL authentication (this will deadlock if server is GDBus < 2.73.3)
17:10:36.6307                       GLib-GIO:    DEBUG: _g_io_module_get_default: Found default implementation gvfs (GDaemonVfs) for ‘gio-vfs’
17:10:36.6514                        Adwaita:    DEBUG: Portal doesn't provide settings: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop
17:10:36.6523                        Adwaita:    DEBUG: Portal doesn't provide settings: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Settings” on object at path /org/freedesktop/portal/desktop
17:10:36.6973                       GLib-GIO:    DEBUG: _g_io_module_get_default: Found default implementation keyfile (GKeyfileSettingsBackend) for ‘gsettings-backend’
17:10:36.6982                       GLib-GIO:    DEBUG: _g_io_module_get_default: Found default implementation gnutls (GTlsBackendGnutls) for ‘gio-tls-backend’
17:10:36.7176                       GLib-GIO:    DEBUG: Using cross-namespace EXTERNAL authentication (this will deadlock if server is GDBus < 2.73.3)
17:10:36.7483                       GLib-GIO:    DEBUG: _g_io_module_get_default: Found default implementation portal (GNetworkMonitorPortal) for ‘gio-network-monitor’
17:10:37.0141                      libportal:    DEBUG: calling background
17:10:37.0184          valent-xdp-background:  WARNING: ValentXdpPlugin: GDBus.Error:org.freedesktop.DBus.Error.UnknownMethod: No such interface “org.freedesktop.portal.Background” on object at path /org/freedesktop/portal/desktop
17:10:37.5002                 valent-battery:    DEBUG: ValentBattery: not a battery
17:10:37.6422        valent-clipboard-plugin:    DEBUG: valent_clipboard_plugin_handle_clipboard_connect(): expected "content" field holding a string
17:10:37.8378        valent-clipboard-plugin:    DEBUG: valent_clipboard_plugin_handle_clipboard_connect(): expected "content" field holding a string

Screenshots

Screenshot_2023-11-18_17-16-40

tomaszn avatar Nov 18 '23 16:11 tomaszn

Thanks for reporting. It seems like the portal might not be setup correctly on your system, or lack URI scheme associations for sftp://.

andyholmes avatar Nov 18 '23 17:11 andyholmes

Maybe that's the reason:

$ xdg-settings get default-url-scheme-handler
xdg-settings: default-url-scheme-handler not implemented for xfce

Any chance to fall back to xdg-open in such a case?

tomaszn avatar Nov 18 '23 18:11 tomaszn

Whether Valent is in a Flatpak or not, it uses standard library APIs (i.e. g_app_info_launch_default_for_uri()), so unfortunately Valent isn't deciding to use the portal. Since GIO knows it's in a sandbox it will just use the portal automatically.

andyholmes avatar Nov 18 '23 21:11 andyholmes

Same after switching to GNOME:

in-gnome

xdg-settings shows nothing for the default handler, but there is a default handler for sftp:

$ xdg-settings get default-url-scheme-handler

$ grep scheme ~/.config/mimeapps.list 
x-scheme-handler/https=xfce4-web-browser.desktop;
x-scheme-handler/trash=xfce4-file-manager.desktop;
x-scheme-handler/sftp=exo-ssh-handler.desktop
x-scheme-handler/http=xfce4-web-browser.desktop
x-scheme-handler/https=xfce4-web-browser.desktop
x-scheme-handler/mailto=xfce4-mail-reader.desktop
x-scheme-handler/trash=xfce4-file-manager.desktop

tomaszn avatar Nov 18 '23 22:11 tomaszn

It looks like xdg-desktop-portal uses g_app_info_get_default_for_type(), which I think checks XDG and the mimeapps, although the rabbit hole gets pretty deep.

I'm not sure there's much to do about this in Valent, though. Maybe the "open" action should be removed and replaced with just a mount/unmount toggle or something.

andyholmes avatar Nov 22 '23 19:11 andyholmes