Update the cursor correctly when it enters and leaves the window.
authorSam Lantinga <slouken@libsdl.org>
Mon, 21 Feb 2011 23:45:48 -0800
changeset 53886e586f65f8ef
parent 5387 03c79d46bf5c
child 5389 24903690f48a
Update the cursor correctly when it enters and leaves the window.
src/video/cocoa/SDL_cocoawindow.m
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Mon Feb 21 23:10:00 2011 -0800
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Mon Feb 21 23:45:48 2011 -0800
     1.3 @@ -255,15 +255,12 @@
     1.4  
     1.5      SDL_SetMouseFocus(_data->window);
     1.6  
     1.7 -    if (!mouse->cursor_shown) {
     1.8 -        [NSCursor hide];
     1.9 -    }
    1.10 +    SDL_SetCursor(NULL);
    1.11  }
    1.12  
    1.13  - (void)mouseExited:(NSEvent *)theEvent
    1.14  {
    1.15      SDL_Window *window = _data->window;
    1.16 -    SDL_Mouse *mouse = SDL_GetMouse();
    1.17  
    1.18      if (SDL_GetMouseFocus() == window) {
    1.19          if (window->flags & SDL_WINDOW_INPUT_GRABBED) {
    1.20 @@ -281,12 +278,11 @@
    1.21              CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, cgpoint);
    1.22          } else {
    1.23              SDL_SetMouseFocus(NULL);
    1.24 +
    1.25 +            [[NSCursor arrowCursor] set];
    1.26 +            [NSCursor unhide];
    1.27          }
    1.28      }
    1.29 -
    1.30 -    if (!mouse->cursor_shown) {
    1.31 -        [NSCursor unhide];
    1.32 -    }
    1.33  }
    1.34  
    1.35  - (void)mouseMoved:(NSEvent *)theEvent