Create the color manager object for a window surface

This commit is contained in:
Kovid Goyal
2025-07-31 15:24:21 +05:30
parent 77106b1035
commit 46114c251b
2 changed files with 7 additions and 0 deletions

1
glfw/wl_platform.h vendored
View File

@@ -172,6 +172,7 @@ typedef struct _GLFWwindowWayland
bool hovered;
bool transparent;
struct wl_surface* surface;
struct wp_color_management_surface_v1 *color_management;
bool waiting_for_swap_to_commit;
struct wl_egl_window* native;
struct wl_callback* callback;

6
glfw/wl_window.c vendored
View File

@@ -583,6 +583,9 @@ static bool createSurface(_GLFWwindow* window,
window);
wl_surface_set_user_data(window->wl.surface, window);
if (_glfw.wl.wp_color_manager_v1 != NULL) {
window->wl.color_management = wp_color_manager_v1_get_surface(_glfw.wl.wp_color_manager_v1, window->wl.surface);
}
// If we already have been notified of the primary monitor scale, assume
// the window will be created on it and so avoid a rescale roundtrip in the common
@@ -1513,6 +1516,9 @@ void _glfwPlatformDestroyWindow(_GLFWwindow* window)
if (window->wl.layer_shell.zwlr_layer_surface_v1)
zwlr_layer_surface_v1_destroy(window->wl.layer_shell.zwlr_layer_surface_v1);
if (window->wl.color_management)
wp_color_management_surface_v1_destroy(window->wl.color_management);
if (window->wl.surface)
wl_surface_destroy(window->wl.surface);