[gtk+/portal: 8/18] Use the portal when sandboxed



commit 8978fe583577638b3fb974767403e9be7570f10a
Author: Matthias Clasen <mclasen redhat com>
Date:   Sat Jun 11 10:23:27 2016 -0400

    Use the portal when sandboxed
    
    Use the sandbox helper api to find out whether to use
    the file chooser portal.

 gtk/gtkfilechoosernativeportal.c |    9 +--------
 1 files changed, 1 insertions(+), 8 deletions(-)
---
diff --git a/gtk/gtkfilechoosernativeportal.c b/gtk/gtkfilechoosernativeportal.c
index dfd4fdc..9cc2610 100644
--- a/gtk/gtkfilechoosernativeportal.c
+++ b/gtk/gtkfilechoosernativeportal.c
@@ -274,14 +274,7 @@ gtk_file_chooser_native_portal_show (GtkFileChooserNative *self)
   const char *signal_name;
   GDBusSignalCallback signal_callback;
 
-  if (g_getenv ("GTK_USE_PORTAL") == NULL)
-    return FALSE;
-
-  if (gtk_file_chooser_get_extra_widget (GTK_FILE_CHOOSER (self)) != NULL)
-    return FALSE;
-
-  update_preview_signal = g_signal_lookup ("update-preview", GTK_TYPE_FILE_CHOOSER);
-  if (g_signal_has_handler_pending (self, update_preview_signal, 0, TRUE))
+  if (!gtk_should_use_portal ())
     return FALSE;
 
   connection = g_bus_get_sync (G_BUS_TYPE_SESSION, NULL, NULL);


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]