Commit 74efb3e8 authored by Rémi Bernon's avatar Rémi Bernon Committed by Alexandre Julliard

winex11.drv: Only call XWarpPointer if we can get exclusive pointer grab.

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: 's avatarRémi Bernon <rbernon@codeweavers.com> Signed-off-by: 's avatarHuw Davies <huw@codeweavers.com> Signed-off-by: 's avatarAlexandre Julliard <julliard@winehq.org>
parent ae4651b7
......@@ -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 );
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment