[prev in list] [next in list] [prev in thread] [next in thread]
List: wine-devel
Subject: [PATCH v4 6/6] winex11.drv: Only call XWarpPointer if we can get exclusive pointer grab
From: Rémi Bernon <rbernon () codeweavers ! com>
Date: 2019-08-30 10:18:03
Message-ID: 20190830101803.14762-7-rbernon () codeweavers ! com
[Download RAW message or body]
XWarpPointer will always succeed, regardless of grabs, so if the pointer
is already grabbed, by some other application, we should not ask to warp
it.
Signed-off-by: Rémi Bernon <rbernon@codeweavers.com>
---
dlls/winex11.drv/mouse.c | 13 +++++++++++++
1 file changed, 13 insertions(+)
diff --git a/dlls/winex11.drv/mouse.c b/dlls/winex11.drv/mouse.c
index fff6fc7047f..8d1dc5e35d7 100644
--- a/dlls/winex11.drv/mouse.c
+++ b/dlls/winex11.drv/mouse.c
@@ -1467,8 +1467,21 @@ BOOL CDECL X11DRV_SetCursorPos( INT x, INT y )
return FALSE;
}
+ if (!clipping_cursor &&
+ XGrabPointer( data->display, root_window, False,
+ PointerMotionMask | ButtonPressMask | ButtonReleaseMask,
+ GrabModeAsync, GrabModeAsync, root_window, None, CurrentTime ) != GrabSuccess)
+ {
+ WARN( "refusing to warp pointer to %u, %u without exclusive grab\n", pos.x, pos.y );
+ return FALSE;
+ }
+
XWarpPointer( data->display, root_window, root_window, 0, 0, 0, 0, pos.x, pos.y );
data->warp_serial = NextRequest( data->display );
+
+ if (!clipping_cursor)
+ XUngrabPointer( data->display, CurrentTime );
+
XNoOp( data->display );
XFlush( data->display ); /* avoids bad mouse lag in games that do their own mouse warping */
TRACE( "warped to %d,%d serial %lu\n", x, y, data->warp_serial );
--
2.23.0.rc1
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic