Having a pointer lock implies that relative motion is also used. When refocusing on a mouselook application which the driver is using relative motion for, an absolute motion hardware input is sent because of handling the wl_pointer.enter event. This can result in an unwanted warp/jerk.
The need to handle enter motion isn't applicable to mouselook or cases where the pointer is locked because the application is drawing its own cursor while covering vscreen, so it can be ignored during pointer lock.
From: Attila Fidan dev@print0.net
Having a pointer lock implies that relative motion is also used. When refocusing on a mouselook application which the driver is using relative motion for, an absolute motion hardware input is sent because of handling the wl_pointer.enter event. This can result in an unwanted warp/jerk.
The need to handle enter motion isn't applicable to mouselook or cases where the pointer is locked because the application is drawing its own cursor while covering vscreen, so it can be ignored during pointer lock. --- dlls/winewayland.drv/wayland_pointer.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/dlls/winewayland.drv/wayland_pointer.c b/dlls/winewayland.drv/wayland_pointer.c index 52aaa337aac..2a7d6f21ede 100644 --- a/dlls/winewayland.drv/wayland_pointer.c +++ b/dlls/winewayland.drv/wayland_pointer.c @@ -111,6 +111,7 @@ static void pointer_handle_enter(void *data, struct wl_pointer *wl_pointer, { struct wayland_pointer *pointer = &process_wayland.pointer; HWND hwnd; + BOOL locked = FALSE;
if (!wl_surface) return; /* The wl_surface user data remains valid and immutable for the whole @@ -122,6 +123,8 @@ static void pointer_handle_enter(void *data, struct wl_pointer *wl_pointer, pthread_mutex_lock(&pointer->mutex); pointer->focused_hwnd = hwnd; pointer->enter_serial = serial; + if (pointer->zwp_locked_pointer_v1) + locked = TRUE; pthread_mutex_unlock(&pointer->mutex);
/* The cursor is undefined at every enter, so we set it again with @@ -131,7 +134,8 @@ static void pointer_handle_enter(void *data, struct wl_pointer *wl_pointer, /* Handle the enter as a motion, to account for cases where the * window first appears beneath the pointer and won't get a separate * motion event. */ - pointer_handle_motion_internal(sx, sy); + if (!locked) + pointer_handle_motion_internal(sx, sy); }
static void pointer_handle_leave(void *data, struct wl_pointer *wl_pointer,