[PATCH] winex11.drv: Ignore XGrabPointer-induced warp events as well

Rémi Bernon rbernon at codeweavers.com
Mon Jul 22 09:55:01 CDT 2019


Sometimes the last of the induced PointerMotion events slips through the
warp_serial filter and trigger spurious mouse motion. This is the case
in Fallout 4, which alternates between fullscreen and smaller cursor
clip rectangles.

Signed-off-by: Rémi Bernon <rbernon at codeweavers.com>
---
 dlls/winex11.drv/mouse.c | 11 ++++++-----
 1 file changed, 6 insertions(+), 5 deletions(-)

diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index f737a306a56..ab7fed383b2 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -411,11 +411,6 @@ static BOOL grab_clipping_window( const RECT *clip )
                        max( 1, clip->right - clip->left ), max( 1, clip->bottom - clip->top ) );
     XMapWindow( data->display, clip_window );

-    /* if the rectangle is shrinking we may get a pointer warp */
-    if (!data->clip_hwnd || clip->left > clip_rect.left || clip->top > clip_rect.top ||
-        clip->right < clip_rect.right || clip->bottom < clip_rect.bottom)
-        data->warp_serial = NextRequest( data->display );
-
     if (!XGrabPointer( data->display, clip_window, False,
                        PointerMotionMask | ButtonPressMask | ButtonReleaseMask,
                        GrabModeAsync, GrabModeAsync, clip_window, None, CurrentTime ))
@@ -427,6 +422,12 @@ static BOOL grab_clipping_window( const RECT *clip )
         DestroyWindow( msg_hwnd );
         return FALSE;
     }
+
+    /* if the rectangle is shrinking we may get a pointer warp */
+    if (!data->clip_hwnd || clip->left > clip_rect.left || clip->top > clip_rect.top ||
+        clip->right < clip_rect.right || clip->bottom < clip_rect.bottom)
+        data->warp_serial = NextRequest( data->display );
+
     clip_rect = *clip;
     if (!data->clip_hwnd) sync_window_cursor( clip_window );
     InterlockedExchangePointer( (void **)&cursor_window, msg_hwnd );
--
2.20.1




More information about the wine-devel mailing list