summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMatthias Clasen <mclasen@redhat.com>2018-08-02 20:54:21 -0400
committerMatthias Clasen <mclasen@redhat.com>2018-08-02 20:54:21 -0400
commite76d17a786ce7f4d5f856d151e6ee9d152d988e6 (patch)
tree96f55ec1208c960f5a2b18e9296bed4a55769a13
parent5ab90f1a8077f05dbc5eafed0b975116c9d9dde0 (diff)
downloadgtk+-e76d17a786ce7f4d5f856d151e6ee9d152d988e6.tar.gz
Only use the portal color picker when appropriate
This is just moving this check around.
-rw-r--r--gtk/gtkcolorpickerportal.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/gtk/gtkcolorpickerportal.c b/gtk/gtkcolorpickerportal.c
index 429c414f4b..da567ae0b9 100644
--- a/gtk/gtkcolorpickerportal.c
+++ b/gtk/gtkcolorpickerportal.c
@@ -18,6 +18,7 @@
#include "config.h"
#include "gtkcolorpickerportalprivate.h"
+#include "gtkprivate.h"
#include <gio/gio.h>
struct _GtkColorPickerPortal
@@ -52,6 +53,9 @@ gtk_color_picker_portal_initable_init (GInitable *initable,
GVariant *ret;
guint version;
+ if (!gtk_should_use_portal ())
+ return FALSE;
+
picker->portal_proxy = g_dbus_proxy_new_for_bus_sync (G_BUS_TYPE_SESSION,
G_DBUS_PROXY_FLAGS_NONE,
NULL,
@@ -63,7 +67,7 @@ gtk_color_picker_portal_initable_init (GInitable *initable,
if (picker->portal_proxy == NULL)
{
- g_debug ("Failed to create screnshot portal proxy");
+ g_debug ("Failed to create screenshot portal proxy");
return FALSE;
}