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.
This commit is contained in:
Kovid Goyal 2025-09-29 08:36:51 +05:30
parent 0d15c6f7c7
commit bdae74d7ed
No known key found for this signature in database
GPG key ID: 06BC317B515ACE7C

8
glfw/wl_window.c vendored
View file

@ -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);
}
}