From 205a0ccd53dd4fa7174eaf6d6fad0b4197b3721b Mon Sep 17 00:00:00 2001 From: Loic Bistuer Date: Mon, 13 Apr 2026 11:13:11 +0700 Subject: [PATCH] wlserver: Send relative pointer motion alongside absolute in mousewarp wlserver_mousemotion sends both relative (zwp_relative_pointer) and absolute (wl_pointer.motion) events to XWayland, but wlserver_mousewarp only sent absolute. This left XWayland's relative_pointer device position stale. When a game entered mouselook (LOCKED pointer constraint), the first relative-only event produced a bogus delta inside XWayland, causing the camera to snap (e.g. to the floor) in affected games. Send wlserver_perform_rel_pointer_motion from wlserver_mousewarp to keep both devices in sync, matching the behavior of wlserver_mousemotion and the --force-grab-cursor code path. --- src/wlserver.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wlserver.cpp b/src/wlserver.cpp index 1631ca780d..fe69b610f0 100644 --- a/src/wlserver.cpp +++ b/src/wlserver.cpp @@ -2703,6 +2703,9 @@ void wlserver_mousewarp( double x, double y, uint32_t time, bool bSynthetic ) { assert( wlserver_is_lock_held() ); + double dx = x - wlserver.mouse_surface_cursorx; + double dy = y - wlserver.mouse_surface_cursory; + wlserver.mouse_surface_cursorx = x; wlserver.mouse_surface_cursory = y; @@ -2714,6 +2717,7 @@ void wlserver_mousewarp( double x, double y, uint32_t time, bool bSynthetic ) wlserver_oncursorevent(); + wlserver_perform_rel_pointer_motion( dx, dy ); wlr_seat_pointer_notify_motion( wlserver.wlr.seat, time, wlserver.mouse_surface_cursorx, wlserver.mouse_surface_cursory ); wlr_seat_pointer_notify_frame( wlserver.wlr.seat ); }