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 1221 - Patch that adds hint to disable the idle timeout on iOS
Summary: Patch that adds hint to disable the idle timeout on iOS
Status: RESOLVED FIXED
Alias: None
Product: SDL
Classification: Unclassified
Component: video (show other bugs)
Version: HG 2.0
Hardware: iPhone/iPod touch iOS (All)
: P2 enhancement
Assignee: Ryan C. Gordon
QA Contact: Sam Lantinga
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-06-10 06:34 UTC by Tim Angus
Modified: 2011-06-15 09:53 UTC (History)
1 user (show)

See Also:


Attachments
Patch that adds hint to disable the idle timeout on iOS (8.81 KB, patch)
2011-06-10 06:34 UTC, Tim Angus
Details | Diff
Patch that adds hint to disable the idle timeout on iOS (10.31 KB, patch)
2011-06-15 02:26 UTC, Tim Angus
Details | Diff
Alternative patch that just adds the missing file (1.72 KB, patch)
2011-06-15 02:29 UTC, Tim Angus
Details | Diff

Note You need to log in before you can comment on or make changes to this bug.
Description Tim Angus 2011-06-10 06:34:30 UTC
Created attachment 621 [details]
Patch that adds hint to disable the idle timeout on iOS

iOS will timeout after about 45 seconds with no input and dim the screen, then subsequently lock the phone. This is fine for applications that always have touch input, but games often use the accelerometer alone. Accelerometer inputs are not counted towards preventing the idle timeout, so if this is the primary means of control, the idle timer must be disabled.

This patch adds a hint SDL_IOS_IDLE_TIMER_DISABLED in order to do this. I found I needed to add a callback facility to the hint system in order to notify any interested parties when a particular hint value changed. This was necessary as there isn't really a convenient place to periodically check the hint value on the iOS port of SDL and only checking the hint once on start up means you can't toggle the setting later on. It's probably quite a useful addition for future hints though, so I don't feel too bad about it.
Comment 1 Ryan C. Gordon 2011-06-13 10:24:44 UTC
This is now hg changeset 3ecad5e5dbe4, thanks!

--ryan.
Comment 2 Ryan C. Gordon 2011-06-14 11:28:01 UTC
Whoops, this patch didn't include SDL_hints_c.h ... can you add that file to this bug report so I can fix the build?

--ryan.
Comment 3 Tim Angus 2011-06-15 02:26:26 UTC
Created attachment 626 [details]
Patch that adds hint to disable the idle timeout on iOS

New patch, now including SDL_hints_c.h. I've got so used to Xcode's svn integration (which auto adds new files to source control) that I completely forgot about the new files. Apologies again.
Comment 4 Tim Angus 2011-06-15 02:29:18 UTC
Created attachment 627 [details]
Alternative patch that just adds the missing file

And here is a patch that just adds the file I missed, without the rest of the changes.
Comment 5 Ryan C. Gordon 2011-06-15 09:53:02 UTC
Thanks, this is in the repo now!

--ryan.