src/video/cocoa/SDL_cocoawindow.m
changeset 7158 ff52fba70795
parent 7113 7b4b596b3cfb
child 7191 75360622e65f
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Mon May 06 23:02:37 2013 +0200
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Tue May 07 16:52:39 2013 -0700
     1.3 @@ -254,7 +254,6 @@
     1.4  
     1.5          if (x >= 0 && x < window->w && y >= 0 && y < window->h) {
     1.6              SDL_SendMouseMotion(window, 0, 0, x, y);
     1.7 -            SDL_SetCursor(NULL);
     1.8          }
     1.9      }
    1.10  
    1.11 @@ -520,6 +519,7 @@
    1.12  @end
    1.13  
    1.14  @interface SDLView : NSView
    1.15 +
    1.16  /* The default implementation doesn't pass rightMouseDown to responder chain */
    1.17  - (void)rightMouseDown:(NSEvent *)theEvent;
    1.18  @end
    1.19 @@ -529,6 +529,20 @@
    1.20  {
    1.21      [[self nextResponder] rightMouseDown:theEvent];
    1.22  }
    1.23 +
    1.24 +- (void)resetCursorRects
    1.25 +{
    1.26 +    [super resetCursorRects];
    1.27 +    SDL_Mouse *mouse = SDL_GetMouse();
    1.28 +
    1.29 +    if (mouse->cursor_shown && mouse->cur_cursor) {
    1.30 +        [self addCursorRect:[self bounds]
    1.31 +                     cursor:mouse->cur_cursor->driverdata];
    1.32 +    } else {
    1.33 +        [self addCursorRect:[self bounds]
    1.34 +                     cursor:[NSCursor invisibleCursor]];
    1.35 +    }
    1.36 +}
    1.37  @end
    1.38  
    1.39  static unsigned int