mirror of
https://github.com/yawut/SDL.git
synced 2026-04-12 11:56:08 -05:00
Change SDL_SetCursor to set the cursor back to the default cursor when the
window is unfocused.
This commit is contained in:
parent
82dd1b8f35
commit
fde369d185
|
|
@ -465,7 +465,11 @@ SDL_SetCursor(SDL_Cursor * cursor)
|
|||
}
|
||||
mouse->cur_cursor = cursor;
|
||||
} else {
|
||||
cursor = mouse->cur_cursor;
|
||||
if (mouse->focus) {
|
||||
cursor = mouse->cur_cursor;
|
||||
} else {
|
||||
cursor = mouse->def_cursor;
|
||||
}
|
||||
}
|
||||
|
||||
if (cursor && mouse->cursor_shown && !mouse->relative_mode) {
|
||||
|
|
|
|||
|
|
@ -92,15 +92,13 @@ Cocoa_ShowCursor(SDL_Cursor * cursor)
|
|||
{
|
||||
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
|
||||
|
||||
if (SDL_GetMouseFocus()) {
|
||||
if (cursor) {
|
||||
NSCursor *nscursor = (NSCursor *)cursor->driverdata;
|
||||
if (cursor) {
|
||||
NSCursor *nscursor = (NSCursor *)cursor->driverdata;
|
||||
|
||||
[nscursor set];
|
||||
[NSCursor unhide];
|
||||
} else {
|
||||
[NSCursor hide];
|
||||
}
|
||||
[nscursor set];
|
||||
[NSCursor unhide];
|
||||
} else {
|
||||
[NSCursor hide];
|
||||
}
|
||||
|
||||
[pool release];
|
||||
|
|
|
|||
|
|
@ -313,9 +313,7 @@ static __inline__ void ConvertNSRect(NSRect *r)
|
|||
CGDisplayMoveCursorToPoint(kCGDirectMainDisplay, cgpoint);
|
||||
} else {
|
||||
SDL_SetMouseFocus(NULL);
|
||||
|
||||
[[NSCursor arrowCursor] set];
|
||||
[NSCursor unhide];
|
||||
SDL_SetCursor(NULL);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user