Module: wine
Branch: master
Commit: a6722029e5e5fa5c44cde09138eb61dd88e16604
URL: http://source.winehq.org/git/wine.git/?a=commit;h=a6722029e5e5fa5c44cde0913…
Author: Ken Thomases <ken(a)codeweavers.com>
Date: Fri Apr 26 04:06:08 2013 -0500
winemac: Work around mouse "pausing" after CGWarpMouseCursorPosition().
---
dlls/winemac.drv/cocoa_app.m | 13 +++++++++++++
1 files changed, 13 insertions(+), 0 deletions(-)
diff --git a/dlls/winemac.drv/cocoa_app.m b/dlls/winemac.drv/cocoa_app.m
index 4e38e3b..cde93d8 100644
--- a/dlls/winemac.drv/cocoa_app.m
+++ b/dlls/winemac.drv/cocoa_app.m
@@ -1049,7 +1049,20 @@ int macdrv_err_on;
{
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)