From 627360e5ade763ed92dce8569f7d9a3535cbec2b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Tue, 27 Aug 2024 11:32:06 +0530 Subject: [PATCH] Bind the idle inhibit protocol even though it is currently unused --- glfw/source-info.json | 1 + glfw/wl_init.c | 6 ++++++ glfw/wl_platform.h | 2 ++ 3 files changed, 9 insertions(+) diff --git a/glfw/source-info.json b/glfw/source-info.json index 89d29f170..3700f046f 100644 --- a/glfw/source-info.json +++ b/glfw/source-info.json @@ -82,6 +82,7 @@ "staging/cursor-shape/cursor-shape-v1.xml", "staging/fractional-scale/fractional-scale-v1.xml", "staging/single-pixel-buffer/single-pixel-buffer-v1.xml", + "unstable/idle-inhibit/idle-inhibit-unstable-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 cacf4abfc..56df744c7 100644 --- a/glfw/wl_init.c +++ b/glfw/wl_init.c @@ -599,6 +599,9 @@ static void registryHandleGlobal(void* data UNUSED, _glfw.wl.zwlr_layer_shell_v1 = wl_registry_bind(registry, name, &zwlr_layer_shell_v1_interface, version); } } + else if (is(zwp_idle_inhibit_manager_v1)) { + _glfw.wl.idle_inhibit_manager = wl_registry_bind(registry, name, &zwp_idle_inhibit_manager_v1_interface, 1); + } #undef is } @@ -679,6 +682,7 @@ get_compositor_missing_capabilities(void) { C(blur, org_kde_kwin_blur_manager); C(server_side_decorations, decorationManager); C(cursor_shape, wp_cursor_shape_manager_v1); C(layer_shell, zwlr_layer_shell_v1); C(single_pixel_buffer, wp_single_pixel_buffer_manager_v1); C(preferred_scale, has_preferred_buffer_scale); + C(idle_inhibit, idle_inhibit_manager); #undef C return buf; } @@ -861,6 +865,8 @@ void _glfwPlatformTerminate(void) org_kde_kwin_blur_manager_destroy(_glfw.wl.org_kde_kwin_blur_manager); if (_glfw.wl.zwlr_layer_shell_v1) zwlr_layer_shell_v1_destroy(_glfw.wl.zwlr_layer_shell_v1); + if (_glfw.wl.idle_inhibit_manager) + zwp_idle_inhibit_manager_v1_destroy(_glfw.wl.idle_inhibit_manager); if (_glfw.wl.registry) wl_registry_destroy(_glfw.wl.registry); diff --git a/glfw/wl_platform.h b/glfw/wl_platform.h index 4fe381f49..53d2f56b9 100644 --- a/glfw/wl_platform.h +++ b/glfw/wl_platform.h @@ -65,6 +65,7 @@ typedef VkBool32 (APIENTRY *PFN_vkGetPhysicalDeviceWaylandPresentationSupportKHR #include "wayland-kwin-blur-v1-client-protocol.h" #include "wayland-wlr-layer-shell-unstable-v1-client-protocol.h" #include "wayland-single-pixel-buffer-v1-client-protocol.h" +#include "wayland-idle-inhibit-unstable-v1-client-protocol.h" #define _glfw_dlopen(name) dlopen(name, RTLD_LAZY | RTLD_LOCAL) #define _glfw_dlclose(handle) dlclose(handle) @@ -338,6 +339,7 @@ typedef struct _GLFWlibraryWayland struct org_kde_kwin_blur_manager *org_kde_kwin_blur_manager; struct zwlr_layer_shell_v1* zwlr_layer_shell_v1; uint32_t zwlr_layer_shell_v1_version; struct wp_single_pixel_buffer_manager_v1 *wp_single_pixel_buffer_manager_v1; + struct zwp_idle_inhibit_manager_v1* idle_inhibit_manager; int compositorVersion; int seatVersion;