From 7b52d1676bfe401b95889ca15309cd955e5e2212 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 21 Feb 2011 23:45:48 -0800 Subject: [PATCH] Update the cursor correctly when it enters and leaves the window. --- src/video/cocoa/SDL_cocoawindow.m | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/src/video/cocoa/SDL_cocoawindow.m b/src/video/cocoa/SDL_cocoawindow.m index 12f97842c..fa6665f00 100644 --- a/src/video/cocoa/SDL_cocoawindow.m +++ b/src/video/cocoa/SDL_cocoawindow.m @@ -255,15 +255,12 @@ - (void)mouseEntered:(NSEvent *)theEvent SDL_SetMouseFocus(_data->window); - if (!mouse->cursor_shown) { - [NSCursor hide]; - } + SDL_SetCursor(NULL); } - (void)mouseExited:(NSEvent *)theEvent { SDL_Window *window = _data->window; - SDL_Mouse *mouse = SDL_GetMouse(); if (SDL_GetMouseFocus() == window) { if (window->flags & SDL_WINDOW_INPUT_GRABBED) { @@ -281,11 +278,10 @@ - (void)mouseExited:(NSEvent *)theEvent CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, cgpoint); } else { SDL_SetMouseFocus(NULL); - } - } - if (!mouse->cursor_shown) { - [NSCursor unhide]; + [[NSCursor arrowCursor] set]; + [NSCursor unhide]; + } } }