Keep mouse cursor state sane on focus change in Quartz driver.
authorRyan C. Gordon <icculus@icculus.org>
Tue, 21 Mar 2006 00:35:22 +0000
changeset 1560 34b9e479047e
parent 1559 e7f61857028a
child 1561 c724c4a99759
Keep mouse cursor state sane on focus change in Quartz driver. Fixes Bugzilla #12.
src/video/quartz/SDL_QuartzEvents.m
--- a/src/video/quartz/SDL_QuartzEvents.m	Mon Mar 20 08:00:07 2006 +0000
+++ b/src/video/quartz/SDL_QuartzEvents.m	Tue Mar 21 00:35:22 2006 +0000
@@ -627,6 +627,12 @@
         QZ_PrivateWarpCursor (this, cursor_loc.x, cursor_loc.y);
         QZ_ChangeGrabState (this, QZ_ENABLE_GRAB);
     }
+    else {
+        /* Update SDL's mouse location */
+        NSPoint p;
+        QZ_GetMouseLocation (this, &p);
+        SDL_PrivateMouseMotion (0, 0, p.x, p.y);
+    }
 }
 
 static void QZ_DoDeactivate (_THIS) {