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 - [Mac] SDL custom cursor doesn't work as (regression in SDL 1.2.11)
Summary: [Mac] SDL custom cursor doesn't work as (regression in SDL 1.2.11)
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 1.2
Hardware: x86 Mac OS X 10.6
: P2 normal
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-12-29 15:49 UTC by Alexei Svitkine
Modified: 2011-12-30 07:25 UTC (History)
1 user (show)

See Also:


Attachments
Patch (862 bytes, patch)
2011-12-29 15:50 UTC, Alexei Svitkine
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
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!