winemac: Work around mouse "pausing" after CGWarpMouseCursorPosition().

This commit is contained in:
Ken Thomases 2013-04-26 04:06:08 -05:00 committed by Alexandre Julliard
parent fa5c708c41
commit a6722029e5
1 changed files with 13 additions and 0 deletions

View File

@ -1049,7 +1049,20 @@ - (BOOL) setCursorPosition:(CGPoint)pos
{
ret = (CGWarpMouseCursorPosition(pos) == kCGErrorSuccess);
if (ret)
{
lastSetCursorPositionTime = [[NSProcessInfo processInfo] systemUptime];
// Annoyingly, CGWarpMouseCursorPosition() effectively disassociates
// the mouse from the cursor position for 0.25 seconds. This means
// that mouse movement during that interval doesn't move the cursor
// and events carry a constant location (the warped-to position)
// even though they have delta values. This screws us up because
// the accumulated deltas we send to Wine don't match any eventual
// absolute position we send (like with a button press). We can
// work around this by simply forcibly reassociating the mouse and
// cursor position.
CGAssociateMouseAndMouseCursorPosition(true);
}
}
if (ret)