From bdae74d7ed592999fe7e611bd4e4b582c58e1cc9 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Mon, 29 Sep 2025 08:36:51 +0530 Subject: [PATCH] Wayland: Ensure color manager get_surface is called just once This should not be needed since create_surface is called just once, but good to be safe. --- glfw/wl_window.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/glfw/wl_window.c b/glfw/wl_window.c index 1251dbe06..6888f5af4 100644 --- a/glfw/wl_window.c +++ b/glfw/wl_window.c @@ -588,9 +588,11 @@ create_surface(_GLFWwindow* window, const _GLFWwndconfig* wndconfig) { if (_glfw.wl.color_manager.has_needed_capabilities) { ensure_color_manager_ready(); - if (_glfw.wl.color_manager.image_description) { - window->wl.color_management = wp_color_manager_v1_get_surface(_glfw.wl.wp_color_manager_v1, window->wl.surface); - wp_color_management_surface_v1_set_image_description(window->wl.color_management, _glfw.wl.color_manager.image_description, WP_COLOR_MANAGER_V1_RENDER_INTENT_PERCEPTUAL); + if (_glfw.wl.color_manager.image_description && !window->wl.color_management) { + window->wl.color_management = wp_color_manager_v1_get_surface( + _glfw.wl.wp_color_manager_v1, window->wl.surface); + wp_color_management_surface_v1_set_image_description( + window->wl.color_management, _glfw.wl.color_manager.image_description, WP_COLOR_MANAGER_V1_RENDER_INTENT_PERCEPTUAL); } }