From 276a70a84fed5be229c12546df1ac393158a4ec9 Mon Sep 17 00:00:00 2001 From: Berke Güzel Date: Tue, 13 Oct 2026 16:23:07 +0300 Subject: Implement relative pointer mode on Wayland yasl_surface_set_pointer_mode(YASL_POINTER_RELATIVE) now takes a persistent zwp_locked_pointer_v1 on the surface and hides its cursor. While the compositor keeps the lock engaged, zwp_relative_pointer_v1 motion is pushed as POINTER_MOTION with pos frozen and delta in device pixels. When the lock disengages, as on focus loss, motion is absolute again with a delta derived by the input queue. The lock follows the pointer's seat: it moves to another seat when its seat loses the pointer, and is released on NORMAL and on surface destruction. Compositors without both protocols return false. Co-Authored-By: Claude Opus 5.5 --- src/platform/wayland/shell.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'src/platform/wayland/shell.c') diff --git a/src/platform/wayland/shell.c b/src/platform/wayland/shell.c index 92c89d1..a12bd4d 100644 --- a/src/platform/wayland/shell.c +++ b/src/platform/wayland/shell.c @@ -208,6 +208,12 @@ static void registry_global(void *data, struct wl_registry *registry, } else if (strcmp(interface, wp_cursor_shape_manager_v1_interface.name) == 0) { c->cursor_shape_mgr = wl_registry_bind(registry, name, &wp_cursor_shape_manager_v1_interface, 1); + } else if (strcmp(interface, zwp_relative_pointer_manager_v1_interface.name) == 0) { + c->relative_pointer_mgr = wl_registry_bind(registry, name, + &zwp_relative_pointer_manager_v1_interface, 1); + } else if (strcmp(interface, zwp_pointer_constraints_v1_interface.name) == 0) { + c->pointer_constraints = wl_registry_bind(registry, name, + &zwp_pointer_constraints_v1_interface, 1); } else if (strcmp(interface, wp_fractional_scale_manager_v1_interface.name) == 0) { c->scale_mgr = wl_registry_bind(registry, name, &wp_fractional_scale_manager_v1_interface, 1); -- cgit v1.2.3