We are currently migrating Bugzilla to GitHub issues.
Any changes made to the bug tracker now will be lost, so please do not post new bugs or make changes to them.
When we're done, all bug URLs will redirect to their equivalent location on the new bug tracker.

Bug 1355

Summary: [Mac] SDL custom cursor doesn't work as (regression in SDL 1.2.11)
Product: SDL Reporter: Alexei Svitkine <alexei.svitkine>
Component: videoAssignee: Ryan C. Gordon <icculus>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: normal    
Priority: P2 CC: icculus
Version: HG 1.2   
Hardware: x86   
OS: Mac OS X 10.6   
Attachments: Patch

Description Alexei Svitkine 2011-12-29 15:49:46 UTC
Setting a custom cursor using SDL_CreateCursor() API has been broken on Mac since SDL 1.2.11. It worked correctly in SDL 1.2.10.

This got broken when SDL_QuartzWM.m was changed to use Cocoa cursor APIs instead of the Carbon ones which were used before.

I'm attaching a patch that fixes this (still using the Cocoa APIs).

The patch fixes two problems:

1. Setting a custom cursor did not work in Windowed mode, because [cursor->nscursor set] would never get called if there was a window.
2. The SDL cursor API would not work unless called from the main thread - a regression from the SDL 1.2.10 implementation which didn't have this requirement.

The attached patch fixes both 1 and 2.

Fixing this would allow SheepShaver, the Mac OS 9 emulator, to use a newer version of SDL than 1.2.10, which it currently has to use due to these problems.
Comment 1 Alexei Svitkine 2011-12-29 15:50:59 UTC
Created attachment 747 [details]
Patch
Comment 2 Alexei Svitkine 2011-12-29 16:05:07 UTC
Hopefully this can make it into SDL 1.2.15.
Comment 3 Ryan C. Gordon 2011-12-30 00:12:31 UTC
Patch seems reasonable to me.

--ryan.
Comment 4 Ryan C. Gordon 2011-12-30 00:23:00 UTC
This patch is now e6fcc5368210, thanks!

--ryan.
Comment 5 Alexei Svitkine 2011-12-30 07:25:15 UTC
Thanks!