Commit 32457cde authored by Matthias Clasen's avatar Matthias Clasen

Use the portal when sandboxed

flatpak creates a file called /run/user/1000/flatpak-info that we
can use to determine whether we are in a sandbox or not.
parent e9b6566d
......@@ -278,10 +278,18 @@ gtk_file_chooser_native_portal_show (GtkFileChooserNative *self)
const char *signal_name;
GDBusSignalCallback signal_callback;
const char *use_portal;
gchar *path;
use_portal = g_getenv ("GTK_USE_PORTAL");
if (!use_portal)
use_portal = "";
path = g_strdup_printf ("/run/user/%d/flatpak-info", getuid());
if (g_file_test (path, G_FILE_TEST_EXISTS))
use_portal = "1";
use_portal = g_getenv ("GTK_USE_PORTAL");
if (!use_portal)
use_portal = "";
g_free (path);
if (g_str_equal (use_portal, "0"))
return FALSE;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment