From: Attila Fidan dev@print0.net
This has the same idea as ignoring it if in relative mode, but the effect is slightly different. Relative motion is disabled while pointer focus is not on the constraint hwnd and re-enabled when pointer focus is back on the constraint hwnd. An absolute motion event may be handled before the foreground thread gets to re-enabling relative motion during ClipCursor, which may result in an unwanted warp/jerk despite the previous commit. --- dlls/winewayland.drv/wayland_pointer.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
diff --git a/dlls/winewayland.drv/wayland_pointer.c b/dlls/winewayland.drv/wayland_pointer.c index b9a31c24b2a..d9d0929d9b8 100644 --- a/dlls/winewayland.drv/wayland_pointer.c +++ b/dlls/winewayland.drv/wayland_pointer.c @@ -97,8 +97,14 @@ static void pointer_handle_motion(void *data, struct wl_pointer *wl_pointer, { struct wayland_pointer *pointer = &process_wayland.pointer;
- /* Ignore absolute motion events if in relative mode. */ - if (pointer->zwp_relative_pointer_v1) return; + /* Ignore absolute motion events if the pointer is locked and the pointer is + * focused on the lock surface. Relative mode is or will be enabled. The + * latter case may happen if a motion event is being handled immediately + * after an enter event, and the foreground thread has yet to re-enable + * relative motion. */ + if (pointer->zwp_locked_pointer_v1 && + pointer->focused_hwnd == pointer->constraint_hwnd) + return;
pointer_handle_motion_internal(sx, sy); }