diff --git a/glfw/wl_init.c b/glfw/wl_init.c index 0062d995a..a03d5c428 100644 --- a/glfw/wl_init.c +++ b/glfw/wl_init.c @@ -462,6 +462,14 @@ on_color_manger_features_done(void *data UNUSED, struct wp_color_manager_v1 *wp_ _glfw.wl.color_manager.capabilities_reported = true; } +static void +on_supported_color_primaries(void *data UNUSED, struct wp_color_manager_v1 *wp_color_manager_v1 UNUSED, uint32_t x) { + switch(x) { + case WP_COLOR_MANAGER_V1_PRIMARIES_SRGB: + _glfw.wl.color_manager.supported_primaries.srgb = true; break; + } +} + 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) { @@ -475,7 +483,7 @@ on_supported_color_transfer_function(void *data UNUSED, struct wp_color_manager_ static const struct wp_color_manager_v1_listener color_manager_listener = { .supported_intent = ignored_color_manager_event, .supported_feature = ignored_color_manager_event, - .supported_primaries_named = ignored_color_manager_event, + .supported_primaries_named = on_supported_color_primaries, .supported_tf_named = on_supported_color_transfer_function, .done = on_color_manger_features_done, }; @@ -757,6 +765,7 @@ get_compositor_missing_capabilities(void) { if (_glfw.wl.xdg_wm_base_version < 5) P("window-capabilities"); if (!_glfw.wl.color_manager.supported_transfer_functions.gamma22) P("gamma22"); if (!_glfw.wl.color_manager.supported_transfer_functions.ext_linear) P("ext_linear"); + if (!_glfw.wl.color_manager.supported_primaries.srgb) P("srgb"); #undef P #undef C while (p > buf && (p - 1)[0] == ' ') { p--; *p = 0; } diff --git a/glfw/wl_platform.h b/glfw/wl_platform.h index 46c02e962..1a4f165d0 100644 --- a/glfw/wl_platform.h +++ b/glfw/wl_platform.h @@ -397,9 +397,8 @@ typedef struct _GLFWlibraryWayland } egl; struct { - struct { - bool gamma22, ext_linear; - } supported_transfer_functions; + struct { bool gamma22, ext_linear; } supported_transfer_functions; + struct { bool srgb; } supported_primaries; bool capabilities_reported; } color_manager;