diff src/video/quartz/SDL_QuartzEvents.m @ 1560:34b9e479047e

Keep mouse cursor state sane on focus change in Quartz driver. Fixes Bugzilla #12.
author Ryan C. Gordon <icculus@icculus.org>
date Tue, 21 Mar 2006 00:35:22 +0000
parents dc6b59e925a2
children ef4a796e7f24
line wrap: on
line diff
--- 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) {