Skip to content

Commit

Permalink
Fixes for setting custom cursor in quartz target.
Browse files Browse the repository at this point in the history
This fixes a logic error, and allows setting the cursor from off the main
 thread, which isn't strictly a good idea, but previous versions of SDL on
 Mac OS X apparently allowed it, so we'll make the effort here.

Fixes Bugzilla #1355.

Thanks to Alexei Svitkine for the patch!
  • Loading branch information
icculus committed Dec 30, 2011
1 parent 15b9d15 commit 1379fc3
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/video/quartz/SDL_QuartzWM.m
Expand Up @@ -124,16 +124,14 @@ int QZ_ShowWMCursor (_THIS, WMcursor *cursor) {
QZ_UpdateCursor(this);
}
else {
if (qz_window ==nil || (mode_flags & SDL_FULLSCREEN)) {
[ cursor->nscursor set ];
}
else {
if ( qz_window != nil && !(mode_flags & SDL_FULLSCREEN) ) {
[ qz_window invalidateCursorRectsForView: [ qz_window contentView ] ];
}
if ( ! cursor_should_be_visible ) {
cursor_should_be_visible = YES;
QZ_ChangeGrabState (this, QZ_SHOWCURSOR);
}
[ cursor->nscursor performSelectorOnMainThread:@selector(set) withObject:nil waitUntilDone:NO ];
QZ_UpdateCursor(this);
}

Expand Down

0 comments on commit 1379fc3

Please sign in to comment.