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 3137

Summary: Mac: Drop runtime support for OS X 10.5
Product: SDL Reporter: Alex Szpakowski <amaranth72>
Component: buildAssignee: Sam Lantinga <slouken>
Status: RESOLVED FIXED QA Contact: Sam Lantinga <slouken>
Severity: minor    
Priority: P2 CC: lrflew, philipp.wiesemann
Version: HG 2.0   
Hardware: x86   
OS: Mac OS X (All)   

Description Alex Szpakowski 2015-10-06 02:07:39 UTC
SDL2 currently supports Mac OS 10.5 systems at runtime.

10.5 is ancient in terms of OS X releases, and most software - especially games - have stopped supporting it years ago. Even steam dropped support for that OS X version a long time ago (and they're also dropping OS X 10.6 support in November, although that's not what this report is about.)

0.00% of Steam users run OS X 10.5. ;)

SDL's codebase has a lot of #ifdef's and conditional codepaths to facilitate runtime support of 10.5. The Cocoa APIs have evolved significantly in some areas over the years, and every time a new change is made to SDL's Cocoa backend it becomes harder to keep 10.5 support working – or to know if it's working at all.

There are also areas of SDL's code that cause runtime warning messages in modern versions of OS X specifically because the code calls functions that were deprecated in 10.6: https://bugzilla.libsdl.org/show_bug.cgi?id=3127

I haven't had a Mac that runs 10.5 to test on for several years. Last time I did, there were unresolved and unreported issues with fullscreen transitions in SDL's code that only happened in conditional codepaths not executed on 10.6 and newer. The fact that these issues are still unreported (I believe they still exist, although I can't verify) is another indicator that continued support of 10.5 in SDL isn't worth it.

It makes a lot of sense to me to drop runtime support for OS X 10.5 either for SDL 2.0.4 or 2.0.5's release.
Comment 1 Alex Szpakowski 2015-10-06 07:18:28 UTC
I pushed a few commits (including Dominik's patch in bug #3127) to my fork, removing 10.5 support: https://bitbucket.org/slime73/sdl-experiments/branch/Mac-no-10.5#diff
Comment 2 LRFLEW 2015-10-19 04:48:07 UTC
I'm not sure where to put this comment, and I don't think this deserves a new issue, so I'm going to put it here.

When you upgrade the project to build for 10.6 instead of 10.5, new warnings appear. In src/video/cocoa/, the files SDL_cocoamouse.m, SDL_cocoamousetap.m, and SDL_cocoawindow.m have the following lines:

CGSetLocalEventsSuppressionInterval(0.0);
CGWarpMouseCursorPosition(point);
CGSetLocalEventsSuppressionInterval(0.25);

(Note, SDL_cocoawindow.m uses CGDisplayMoveCursorToPoint, but they're doing pretty much the same thing)

The problem with these lines is that CGSetLocalEventsSuppressionInterval was deprecated as of 10.6. While the comments added in SDL_cocoamouse.m and SDL_cocoawindow.m mention CGEventSource, this doesn't actually seem to be the answer. The implementation in the code now seems like a workaround instead of the actual solution. When searching this problem, I found this alternative solution:

CGWarpMouseCursorPosition(point);
CGAssociateMouseAndMouseCursorPosition(true);

This solution avoids messing with the suppression intervals completely, and just performs the action required.
Comment 3 Alex Szpakowski 2015-10-19 04:49:26 UTC
I think I tried that solution at one point, but it didn't quite work properly. Maybe my implementation was imperfect though.
Comment 4 LRFLEW 2015-10-19 05:30:21 UTC
(In reply to Alex Szpakowski from comment #3)
> I think I tried that solution at one point, but it didn't quite work
> properly. Maybe my implementation was imperfect though.

Do you mind clarify what didn't work correctly? I tried it with a simple test case (resetting the mouse to the center of the window each frame) and I was unable to see any difference.
Comment 5 Alex Szpakowski 2015-10-19 05:32:14 UTC
(In reply to LRFLEW from comment #4)
> Do you mind clarify what didn't work correctly? I tried it with a simple
> test case (resetting the mouse to the center of the window each frame) and I
> was unable to see any difference.

I don't actually remember. Maybe I'll test it again later this week.
Comment 6 Alex Szpakowski 2016-03-20 18:52:56 UTC
I've replaced CGSetLocalEventsSuppressionInterval with CGAssociateMouseAndMouseCursorPosition in https://hg.libsdl.org/SDL/rev/f0645cd8fd39
Comment 7 Alex Szpakowski 2016-05-21 03:22:02 UTC
Removed via this commit: https://hg.libsdl.org/SDL/rev/3115d38204aa
Comment 8 Philipp Wiesemann 2016-06-11 22:09:29 UTC
The SDL buildbot fails to compile for Mac OS X since this commit.
Comment 9 Philipp Wiesemann 2016-06-24 17:20:35 UTC
The SDL buildbot compile failure was fixed here: http://hg.libsdl.org/SDL/rev/4980c48b8dbe