Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Mac: Fix cursor not updating when re-focusing the window.
Browse files Browse the repository at this point in the history
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
  • Loading branch information
jorgenpt committed Apr 24, 2013
1 parent cb49b35 commit b5717a3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/video/cocoa/SDL_cocoamouse.m
Expand Up @@ -162,7 +162,13 @@
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];
Expand Down

0 comments on commit b5717a3

Please sign in to comment.