From ead04fe615d84c046321fef64bf01fd97bbf91a9 Mon Sep 17 00:00:00 2001 From: Matthias Clasen Date: Thu, 14 Nov 2024 12:55:19 -0500 Subject: [PATCH] Make color management opt-in People were experiencing some issues when running GTK 4.16 apps under kwin, which now enables the experimental Wayland protocol by default. While the testing is valuable, we don't want to make users of the stable GTK guinea pigs, so switch color management from opt-out to opt-in. Use GDK_DEBUG=color-mgmt to enable use of the xx-color-manager-v4 protocol. --- docs/reference/gtk/running.md | 6 +++--- gdk/gdk.c | 2 +- gdk/gdkdebugprivate.h | 2 +- gdk/wayland/gdkdisplay-wayland.c | 2 +- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/reference/gtk/running.md b/docs/reference/gtk/running.md index b1d5d4a0d4..faf63c6e62 100644 --- a/docs/reference/gtk/running.md +++ b/docs/reference/gtk/running.md @@ -248,6 +248,9 @@ A number of options affect behavior instead of logging: `no-vsync` : Repaint instantly (uses 100% CPU with animations) +`color-mgmt` +: Enable color management + The special value `all` can be used to turn on all debug options. The special value `help` can be used to obtain a list of all supported debug options. @@ -355,9 +358,6 @@ disable certain features. `offload` : Disable graphics offload to subsurfaces -`color-mgmt` -: Disable color management - ### `GDK_GL_DISABLE` This variable can be set to a list of values, which cause GDK to diff --git a/gdk/gdk.c b/gdk/gdk.c index 13856d2d30..57407f7efd 100644 --- a/gdk/gdk.c +++ b/gdk/gdk.c @@ -139,6 +139,7 @@ static const GdkDebugKey gdk_debug_keys[] = { { "default-settings",GDK_DEBUG_DEFAULT_SETTINGS, "Force default values for xsettings" }, { "high-depth", GDK_DEBUG_HIGH_DEPTH, "Use high bit depth rendering if possible" }, { "no-vsync", GDK_DEBUG_NO_VSYNC, "Repaint instantly (uses 100% CPU with animations)" }, + { "color-mgmt", GDK_DEBUG_COLOR_MANAGEMENT, "Enable color management" }, }; static const GdkDebugKey gdk_feature_keys[] = { @@ -151,7 +152,6 @@ static const GdkDebugKey gdk_feature_keys[] = { { "vulkan", GDK_FEATURE_VULKAN, "Disable Vulkan support" }, { "dmabuf", GDK_FEATURE_DMABUF, "Disable dmabuf support" }, { "offload", GDK_FEATURE_OFFLOAD, "Disable graphics offload" }, - { "color-mgmt", GDK_FEATURE_COLOR_MANAGEMENT, "Disable color management" }, }; diff --git a/gdk/gdkdebugprivate.h b/gdk/gdkdebugprivate.h index ad7de9a9d5..63779125ec 100644 --- a/gdk/gdkdebugprivate.h +++ b/gdk/gdkdebugprivate.h @@ -51,6 +51,7 @@ typedef enum { GDK_DEBUG_DEFAULT_SETTINGS= 1 << 21, GDK_DEBUG_HIGH_DEPTH = 1 << 22, GDK_DEBUG_NO_VSYNC = 1 << 23, + GDK_DEBUG_COLOR_MANAGEMENT= 1 << 24, } GdkDebugFlags; typedef enum { @@ -63,7 +64,6 @@ typedef enum { GDK_FEATURE_VULKAN = 1 << 6, GDK_FEATURE_DMABUF = 1 << 7, GDK_FEATURE_OFFLOAD = 1 << 8, - GDK_FEATURE_COLOR_MANAGEMENT = 1 << 9, } GdkFeatures; #define GDK_ALL_FEATURES ((1 << 10) - 1) diff --git a/gdk/wayland/gdkdisplay-wayland.c b/gdk/wayland/gdkdisplay-wayland.c index 2f244f508c..79b5b87b00 100644 --- a/gdk/wayland/gdkdisplay-wayland.c +++ b/gdk/wayland/gdkdisplay-wayland.c @@ -536,7 +536,7 @@ gdk_registry_handle_global (void *data, MIN (version, 1)); } else if (strcmp (interface, xx_color_manager_v4_interface.name) == 0 && - gdk_has_feature (GDK_FEATURE_COLOR_MANAGEMENT)) + GDK_DISPLAY_DEBUG_CHECK (GDK_DISPLAY (display_wayland), COLOR_MANAGEMENT)) { display_wayland->color = gdk_wayland_color_new (display_wayland, registry, id, version); }