src/video/cocoa/SDL_cocoawindow.m
changeset 7158 ff52fba70795
parent 7113 7b4b596b3cfb
child 7191 75360622e65f
--- a/src/video/cocoa/SDL_cocoawindow.m	Mon May 06 23:02:37 2013 +0200
+++ b/src/video/cocoa/SDL_cocoawindow.m	Tue May 07 16:52:39 2013 -0700
@@ -254,7 +254,6 @@
 
         if (x >= 0 && x < window->w && y >= 0 && y < window->h) {
             SDL_SendMouseMotion(window, 0, 0, x, y);
-            SDL_SetCursor(NULL);
         }
     }
 
@@ -520,6 +519,7 @@
 @end
 
 @interface SDLView : NSView
+
 /* The default implementation doesn't pass rightMouseDown to responder chain */
 - (void)rightMouseDown:(NSEvent *)theEvent;
 @end
@@ -529,6 +529,20 @@
 {
     [[self nextResponder] rightMouseDown:theEvent];
 }
+
+- (void)resetCursorRects
+{
+    [super resetCursorRects];
+    SDL_Mouse *mouse = SDL_GetMouse();
+
+    if (mouse->cursor_shown && mouse->cur_cursor) {
+        [self addCursorRect:[self bounds]
+                     cursor:mouse->cur_cursor->driverdata];
+    } else {
+        [self addCursorRect:[self bounds]
+                     cursor:[NSCursor invisibleCursor]];
+    }
+}
 @end
 
 static unsigned int