From 8762576a5b137a950d896deca91d7f0826e52588 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 31 Jul 2025 15:12:26 +0530 Subject: [PATCH] Also track support for extlinear transfer function --- glfw/wl_init.c | 8 +++++--- glfw/wl_platform.h | 4 +++- 2 files changed, 8 insertions(+), 4 deletions(-) diff --git a/glfw/wl_init.c b/glfw/wl_init.c index 6739ecf17..bf41d107f 100644 --- a/glfw/wl_init.c +++ b/glfw/wl_init.c @@ -466,8 +466,9 @@ static void on_supported_color_transfer_function(void *data UNUSED, struct wp_color_manager_v1 *wp_color_manager_v1 UNUSED, uint32_t x) { switch(x) { case WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_GAMMA22: - _glfw.wl.color_manager.supports_gamma22_transfer_function = true; - break; + _glfw.wl.color_manager.supported_transfer_functions.gamma22 = true; break; + case WP_COLOR_MANAGER_V1_TRANSFER_FUNCTION_EXT_LINEAR: + _glfw.wl.color_manager.supported_transfer_functions.ext_linear = true; break; } } @@ -753,7 +754,8 @@ get_compositor_missing_capabilities(void) { C(color-manager, wp_color_manager_v1); if (_glfw.wl.xdg_wm_base_version < 6) p += snprintf(p, sizeof(buf) - (p - buf), "%s ", "window-state-suspended"); if (_glfw.wl.xdg_wm_base_version < 5) p += snprintf(p, sizeof(buf) - (p - buf), "%s ", "window-capabilities"); - if (!_glfw.wl.color_manager.supports_gamma22_transfer_function) p += snprintf(p, sizeof(buf) - (p - buf), "%s ", "gamma22"); + if (!_glfw.wl.color_manager.supported_transfer_functions.gamma22) p += snprintf(p, sizeof(buf) - (p - buf), "%s ", "gamma22"); + if (!_glfw.wl.color_manager.supported_transfer_functions.ext_linear) p += snprintf(p, sizeof(buf) - (p - buf), "%s ", "ext_linear"); #undef C while (p > buf && (p - 1)[0] == ' ') { p--; *p = 0; } return buf; diff --git a/glfw/wl_platform.h b/glfw/wl_platform.h index 5e7d64f94..df9c287cb 100644 --- a/glfw/wl_platform.h +++ b/glfw/wl_platform.h @@ -396,7 +396,9 @@ typedef struct _GLFWlibraryWayland } egl; struct { - bool supports_gamma22_transfer_function; + struct { + bool gamma22, ext_linear; + } supported_transfer_functions; bool capabilities_reported; } color_manager;