From a2c296badc9fb4ddca06a49339c1ffbb9568a69d Mon Sep 17 00:00:00 2001 From: Ondrej Holy Date: Mon, 27 Feb 2023 10:54:25 +0100 Subject: gdaemonfile: Disable push/pull for Flatpak The push/pull methods rely on local paths. This is a problem for Flatpak applications because the GVfs daemons run outside of it, so the same local path might refer to a different file. Let's disable the push/pull methods for Flatpak applications to fix errors when moving/copying. Related: https://github.com/flathub/org.libreoffice.LibreOffice/issues/23 --- client/gdaemonfile.c | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'client') diff --git a/client/gdaemonfile.c b/client/gdaemonfile.c index 2d09f6af..39847ddf 100644 --- a/client/gdaemonfile.c +++ b/client/gdaemonfile.c @@ -2680,6 +2680,7 @@ file_transfer (GFile *source, gboolean dest_is_daemon; gboolean native_transfer; gboolean send_progress; + gboolean flatpak_sandbox; GVfsDBusMount *proxy; gchar *path1, *path2; GDBusConnection *connection; @@ -2695,13 +2696,14 @@ file_transfer (GFile *source, source_is_daemon = G_IS_DAEMON_FILE (source); dest_is_daemon = G_IS_DAEMON_FILE (destination); send_progress = progress_callback != NULL; + flatpak_sandbox = g_file_test ("/.flatpak-info", G_FILE_TEST_EXISTS); serial = 0; if (source_is_daemon && dest_is_daemon) native_transfer = TRUE; - else if (dest_is_daemon && !source_is_daemon) + else if (dest_is_daemon && !source_is_daemon && !flatpak_sandbox) local_path = g_file_get_path (source); - else if (source_is_daemon && !dest_is_daemon) + else if (source_is_daemon && !dest_is_daemon && !flatpak_sandbox) local_path = g_file_get_path (destination); else { -- cgit v1.2.1