Update the cursor correctly when it enters and leaves the window.
This commit is contained in:
parent
1918f54080
commit
92bf0fc2fd
1 changed files with 4 additions and 8 deletions
|
@ -255,15 +255,12 @@ static __inline__ void ConvertNSRect(NSRect *r)
|
||||||
|
|
||||||
SDL_SetMouseFocus(_data->window);
|
SDL_SetMouseFocus(_data->window);
|
||||||
|
|
||||||
if (!mouse->cursor_shown) {
|
SDL_SetCursor(NULL);
|
||||||
[NSCursor hide];
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)mouseExited:(NSEvent *)theEvent
|
- (void)mouseExited:(NSEvent *)theEvent
|
||||||
{
|
{
|
||||||
SDL_Window *window = _data->window;
|
SDL_Window *window = _data->window;
|
||||||
SDL_Mouse *mouse = SDL_GetMouse();
|
|
||||||
|
|
||||||
if (SDL_GetMouseFocus() == window) {
|
if (SDL_GetMouseFocus() == window) {
|
||||||
if (window->flags & SDL_WINDOW_INPUT_GRABBED) {
|
if (window->flags & SDL_WINDOW_INPUT_GRABBED) {
|
||||||
|
@ -281,12 +278,11 @@ static __inline__ void ConvertNSRect(NSRect *r)
|
||||||
CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, cgpoint);
|
CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, cgpoint);
|
||||||
} else {
|
} else {
|
||||||
SDL_SetMouseFocus(NULL);
|
SDL_SetMouseFocus(NULL);
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!mouse->cursor_shown) {
|
[[NSCursor arrowCursor] set];
|
||||||
[NSCursor unhide];
|
[NSCursor unhide];
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)mouseMoved:(NSEvent *)theEvent
|
- (void)mouseMoved:(NSEvent *)theEvent
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue