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 1642 - iOS: Game Center leaderboard views don't work properly when using SDL_PumpEvents()
Summary: iOS: Game Center leaderboard views don't work properly when using SDL_PumpEve...
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: events (show other bugs)
Version: HG 2.0
Hardware: iPhone/iPod touch iOS 5
: P2 normal
Assignee: Sam Lantinga
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2012-11-12 11:05 UTC by David Ludwig
Modified: 2012-11-22 12:50 UTC (History)
0 users

See Also:


Attachments
patches UIKit_PumpEvents to allow GKLeaderboardViewController to work properly on iOS 5.x (2.35 KB, application/octet-stream)
2012-11-12 11:05 UTC, David Ludwig
Details

Note You need to log in before you can comment on or make changes to this bug.
Description David Ludwig 2012-11-12 11:05:18 UTC
Created attachment 989 [details]
patches UIKit_PumpEvents to allow GKLeaderboardViewController to work properly on iOS 5.x

On iOS 5.x and earlier, when using SDL 2.x in conjunction with SDL_PumpEvents(), Game Center leaderboard views, as displayed via iOS' GKLeaderboardViewController class, won't scroll properly.  The view will display, however any attempts to scroll its contents, or click on certain UI elements, won't work.

On iOS 6.x, this bug does not occur.

One possible fix is to use SDL 2.x's SDL_iPhoneSetAnimationCallback API.  This seems to require that the app's event loop get moved out of the app's own code, and into iOS.  This may be difficult in some older codebases, which haven't been factored for such a thin.

Attached is a patch that modifies the iOS/UIKit-specific portion of SDL_PumpEvents in such a way to allow GKLeaderboardViewController to work properly for apps that use SDL_PumpEvents for event processing, rather than SDL_iPhoneSetAnimationCallback.  Such a fix might not be entirely ideal for all iOS applications, as there may be cases whereby iOS prefers that certain events be responded to directly from their callbacks (in the UIApplication delegate), however I have used a similar fix in apps available in the App Store.

To note, I made this patch using the 'hg export' command from a custom branch of SDL's source code.  I've tested it with the latest SDL 2.x code as of this writing (on Nov. 12, 2012).  I normally don't work with Mercurial, nor OS X's diff command, and am not entirely certain if this is a good way to create patches.  If not, and if anyone is interested in using this fix, but could use a .diff file made with a different toolset, or with different options, please let me know.
Comment 1 Sam Lantinga 2012-11-22 12:50:49 UTC
This is a great way to send patches, thanks!
Your patch has been applied.