winemac: Work around mouse "pausing" after CGWarpMouseCursorPosition().
This commit is contained in:
parent
fa5c708c41
commit
a6722029e5
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue