summaryrefslogtreecommitdiff
path: root/gdk
diff options
context:
space:
mode:
authorBenjamin Otte <otte@redhat.com>2022-06-24 02:15:25 +0200
committerBenjamin Otte <otte@redhat.com>2022-06-24 03:14:50 +0200
commit813dd0a6749a9bae9f5f2ff229e7284471b35b43 (patch)
tree7a4efa2be6285c449d7170c1de2ccec3669661cc /gdk
parentbbfacb4d226e4b2e1778dc6fadd1fe50ea08c1e4 (diff)
downloadgtk+-813dd0a6749a9bae9f5f2ff229e7284471b35b43.tar.gz
gdk: Replace GTK_USE_PORTAL env var with GDK_DEBUG flag
It's a debug flag, so make it clear that it is one. Related: Clowns on the Arch wiki on https://wiki.archlinux.org/title/Uniform_look_for_Qt_and_GTK_applications#Consistent_file_dialog
Diffstat (limited to 'gdk')
-rw-r--r--gdk/gdk.c19
-rw-r--r--gdk/gdkdebug.h27
2 files changed, 20 insertions, 26 deletions
diff --git a/gdk/gdk.c b/gdk/gdk.c
index d40c5ee4df..4d3e4eb5b6 100644
--- a/gdk/gdk.c
+++ b/gdk/gdk.c
@@ -117,6 +117,7 @@ static const GdkDebugKey gdk_debug_keys[] = {
{ "selection", GDK_DEBUG_SELECTION, "Information about selections" },
{ "clipboard", GDK_DEBUG_CLIPBOARD, "Information about clipboards" },
{ "nograbs", GDK_DEBUG_NOGRABS, "Disable pointer and keyboard grabs (X11)" },
+ { "portals", GDK_DEBUG_PORTALS, "Force the use of portals" },
{ "gl-disable", GDK_DEBUG_GL_DISABLE, "Disable OpenGL support" },
{ "gl-software", GDK_DEBUG_GL_SOFTWARE, "Force OpenGL software rendering" },
{ "gl-texture-rect", GDK_DEBUG_GL_TEXTURE_RECT, "Use OpenGL texture rectangle extension" },
@@ -360,21 +361,13 @@ gdk_running_in_sandbox (void)
gboolean
gdk_should_use_portal (void)
{
- static const char *use_portal = NULL;
+ if (GDK_DISPLAY_DEBUG_CHECK (NULL, PORTALS))
+ return TRUE;
- if (G_UNLIKELY (use_portal == NULL))
- {
- if (gdk_running_in_sandbox ())
- use_portal = "1";
- else
- {
- use_portal = g_getenv ("GTK_USE_PORTAL");
- if (!use_portal)
- use_portal = "";
- }
- }
+ if (gdk_running_in_sandbox ())
+ return TRUE;
- return use_portal[0] == '1';
+ return FALSE;
}
PangoDirection
diff --git a/gdk/gdkdebug.h b/gdk/gdkdebug.h
index acd2259440..34499edc95 100644
--- a/gdk/gdkdebug.h
+++ b/gdk/gdkdebug.h
@@ -38,19 +38,20 @@ typedef enum {
GDK_DEBUG_CLIPBOARD = 1 << 10,
/* flags below are influencing behavior */
GDK_DEBUG_NOGRABS = 1 << 11,
- GDK_DEBUG_GL_DISABLE = 1 << 12,
- GDK_DEBUG_GL_SOFTWARE = 1 << 13,
- GDK_DEBUG_GL_TEXTURE_RECT = 1 << 14,
- GDK_DEBUG_GL_LEGACY = 1 << 15,
- GDK_DEBUG_GL_GLES = 1 << 16,
- GDK_DEBUG_GL_DEBUG = 1 << 17,
- GDK_DEBUG_GL_EGL = 1 << 18,
- GDK_DEBUG_GL_GLX = 1 << 19,
- GDK_DEBUG_GL_WGL = 1 << 20,
- GDK_DEBUG_VULKAN_DISABLE = 1 << 21,
- GDK_DEBUG_VULKAN_VALIDATE = 1 << 22,
- GDK_DEBUG_DEFAULT_SETTINGS= 1 << 23,
- GDK_DEBUG_HIGH_DEPTH = 1 << 24,
+ GDK_DEBUG_PORTALS = 1 << 12,
+ GDK_DEBUG_GL_DISABLE = 1 << 13,
+ GDK_DEBUG_GL_SOFTWARE = 1 << 14,
+ GDK_DEBUG_GL_TEXTURE_RECT = 1 << 15,
+ GDK_DEBUG_GL_LEGACY = 1 << 16,
+ GDK_DEBUG_GL_GLES = 1 << 17,
+ GDK_DEBUG_GL_DEBUG = 1 << 18,
+ GDK_DEBUG_GL_EGL = 1 << 19,
+ GDK_DEBUG_GL_GLX = 1 << 20,
+ GDK_DEBUG_GL_WGL = 1 << 21,
+ GDK_DEBUG_VULKAN_DISABLE = 1 << 22,
+ GDK_DEBUG_VULKAN_VALIDATE = 1 << 23,
+ GDK_DEBUG_DEFAULT_SETTINGS= 1 << 24,
+ GDK_DEBUG_HIGH_DEPTH = 1 << 25,
} GdkDebugFlags;
extern guint _gdk_debug_flags;