Mac: Fix cursor not updating when re-focusing the window.
This fixes a bug where [NSCursor set] doesn't take when called in certain event handlers (like windowDidBecomeKey:). http://bugzilla.libsdl.org/show_bug.cgi?id=1795 --HG-- extra : histedit_source : 3f150addd3b1b7bc6397aba60ccf05f9065ffb8c
This commit is contained in:
parent
059ea2c1c6
commit
7d048468d3
1 changed files with 7 additions and 1 deletions
|
@ -162,7 +162,13 @@ Cocoa_ShowCursor(SDL_Cursor * cursor)
|
|||
if (cursor) {
|
||||
NSCursor *nscursor = (NSCursor *)cursor->driverdata;
|
||||
|
||||
[nscursor set];
|
||||
/* We're possibly executing from an event handler where this operation
|
||||
* is unsupported. This will execute it in the main Cocoa event loop
|
||||
* after this returns.
|
||||
*/
|
||||
[nscursor performSelectorOnMainThread:@selector(set)
|
||||
withObject:nil
|
||||
waitUntilDone:NO];
|
||||
|
||||
if (!isShown) {
|
||||
[NSCursor unhide];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue