{ "selection", GDK_DEBUG_SELECTION, "Information about selections" },
{ "clipboard", GDK_DEBUG_CLIPBOARD, "Information about clipboards" },
{ "nograbs", GDK_DEBUG_NOGRABS, "Disable pointer and keyboard grabs (X11)", TRUE },
- { "portals", GDK_DEBUG_PORTALS, "Force the use of portals", TRUE },
+ { "portals", GDK_DEBUG_PORTALS, "Force use of portals", TRUE },
+ { "no-portals", GDK_DEBUG_NO_PORTALS, "Disable use of portals", TRUE },
{ "gl-disable", GDK_DEBUG_GL_DISABLE, "Disable OpenGL support", TRUE },
{ "gl-debug", GDK_DEBUG_GL_DEBUG, "Insert debugging information in OpenGL", TRUE },
{ "gl-legacy", GDK_DEBUG_GL_LEGACY, "Use a legacy OpenGL context", TRUE },
if (gdk_display_get_debug_flags (NULL) & GDK_DEBUG_PORTALS)
return TRUE;
+ if (gdk_display_get_debug_flags (NULL) & GDK_DEBUG_NO_PORTALS)
+ return FALSE;
+
if (gdk_running_in_sandbox ())
return TRUE;
/* flags below are influencing behavior */
GDK_DEBUG_NOGRABS = 1 << 11,
GDK_DEBUG_PORTALS = 1 << 12,
- GDK_DEBUG_GL_DISABLE = 1 << 13,
+ GDK_DEBUG_NO_PORTALS = 1 << 13,
+ GDK_DEBUG_GL_DISABLE = 1 << 14,
GDK_DEBUG_GL_LEGACY = 1 << 16,
GDK_DEBUG_GL_GLES = 1 << 17,
GDK_DEBUG_GL_DEBUG = 1 << 18,
#include "gtkfilechoosernativeprivate.h"
#include "gtkdialogerror.h"
#include <glib/gi18n-lib.h>
+#include "gdk/gdkdebugprivate.h"
/**
* GtkFileDialog:
GtkFileChooserNative *chooser;
const char *accept;
const char *default_title, *title;
+ GdkDisplay *display;
switch (action)
{
title = default_title;
chooser = gtk_file_chooser_native_new (title, parent, action, accept, _("_Cancel"));
- gtk_file_chooser_native_set_use_portal (chooser, TRUE);
+
+ if (parent)
+ display = gtk_widget_get_display (GTK_WIDGET (parent));
+ else
+ display = gdk_display_get_default ();
+
+ if (GDK_DISPLAY_DEBUG_CHECK (display, NO_PORTALS))
+ gtk_file_chooser_native_set_use_portal (chooser, FALSE);
+ else
+ gtk_file_chooser_native_set_use_portal (chooser, TRUE);
gtk_native_dialog_set_modal (GTK_NATIVE_DIALOG (chooser), self->modal);
gtk_file_chooser_set_select_multiple (GTK_FILE_CHOOSER (chooser), select_multiple);