From f04e963683e3e73f1c3e88f5d8b14486b80e4186 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 31 Jul 2025 14:37:42 +0530 Subject: [PATCH] Bind the wayland color manager interface --- glfw/source-info.json | 1 + glfw/wl_init.c | 5 +++++ glfw/wl_platform.h | 2 ++ 3 files changed, 8 insertions(+) diff --git a/glfw/source-info.json b/glfw/source-info.json index 31a3e096a..cfa47a651 100644 --- a/glfw/source-info.json +++ b/glfw/source-info.json @@ -88,6 +88,7 @@ "staging/xdg-toplevel-icon/xdg-toplevel-icon-v1.xml", "staging/xdg-system-bell/xdg-system-bell-v1.xml", "staging/xdg-toplevel-tag/xdg-toplevel-tag-v1.xml", + "staging/color-management/color-management-v1.xml", "kwin-blur-v1.xml", "wlr-layer-shell-unstable-v1.xml" diff --git a/glfw/wl_init.c b/glfw/wl_init.c index eb07d5813..ea43816fb 100644 --- a/glfw/wl_init.c +++ b/glfw/wl_init.c @@ -610,6 +610,8 @@ static void registryHandleGlobal(void* data UNUSED, _glfw.wl.xdg_system_bell_v1 = wl_registry_bind(registry, name, &xdg_system_bell_v1_interface, 1); } else if (is(xdg_toplevel_tag_manager_v1)) { _glfw.wl.xdg_toplevel_tag_manager_v1 = wl_registry_bind(registry, name, &xdg_toplevel_tag_manager_v1_interface, 1); + } else if (is(wp_color_manager_v1)) { + _glfw.wl.wp_color_manager_v1 = wl_registry_bind(registry, name, &wp_color_manager_v1_interface, 1); } #undef is } @@ -722,6 +724,7 @@ get_compositor_missing_capabilities(void) { C(single_pixel_buffer, wp_single_pixel_buffer_manager_v1); C(preferred_scale, has_preferred_buffer_scale); C(idle_inhibit, idle_inhibit_manager); C(icon, xdg_toplevel_icon_manager_v1); C(bell, xdg_system_bell_v1); C(window-tag, xdg_toplevel_tag_manager_v1); C(keyboard_shortcuts_inhibit, keyboard_shortcuts_inhibit_manager); + 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"); #undef C @@ -902,6 +905,8 @@ void _glfwPlatformTerminate(void) xdg_system_bell_v1_destroy(_glfw.wl.xdg_system_bell_v1); if (_glfw.wl.xdg_toplevel_tag_manager_v1) xdg_toplevel_tag_manager_v1_destroy(_glfw.wl.xdg_toplevel_tag_manager_v1); + if (_glfw.wl.wp_color_manager_v1) + wp_color_manager_v1_destroy(_glfw.wl.wp_color_manager_v1); if (_glfw.wl.wp_single_pixel_buffer_manager_v1) wp_single_pixel_buffer_manager_v1_destroy(_glfw.wl.wp_single_pixel_buffer_manager_v1); if (_glfw.wl.wp_cursor_shape_manager_v1) diff --git a/glfw/wl_platform.h b/glfw/wl_platform.h index 78a7a9fc8..ae616f80c 100644 --- a/glfw/wl_platform.h +++ b/glfw/wl_platform.h @@ -70,6 +70,7 @@ typedef VkBool32 (APIENTRY *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR #include "wayland-xdg-toplevel-icon-v1-client-protocol.h" #include "wayland-xdg-system-bell-v1-client-protocol.h" #include "wayland-xdg-toplevel-tag-v1-client-protocol.h" +#include "wayland-color-management-v1-client-protocol.h" #define _glfw_dlopen(name) dlopen(name, RTLD_LAZY | RTLD_LOCAL) #define _glfw_dlclose(handle) dlclose(handle) @@ -344,6 +345,7 @@ typedef struct _GLFWlibraryWayland struct xdg_toplevel_icon_manager_v1* xdg_toplevel_icon_manager_v1; struct xdg_system_bell_v1* xdg_system_bell_v1; struct xdg_toplevel_tag_manager_v1* xdg_toplevel_tag_manager_v1; + struct wp_color_manager_v1* wp_color_manager_v1; struct wp_cursor_shape_manager_v1* wp_cursor_shape_manager_v1; struct wp_cursor_shape_device_v1* wp_cursor_shape_device_v1; struct wp_fractional_scale_manager_v1 *wp_fractional_scale_manager_v1;