Remove SDL_HINT_IDLE_TIMER_DISABLED.

SDL_DisableScreenSaver can be used instead. Fixes #6660.
This commit is contained in:
Sasha Szpakowski
2022-11-26 23:03:06 -04:00
committed by Sam Lantinga
parent 0a48abc860
commit 80a9397459
5 changed files with 4 additions and 37 deletions

View File

@@ -75,13 +75,6 @@ int SDL_UIKitRunApp(int argc, char *argv[], SDL_main_func mainFunction)
return exit_status;
}
static void SDLCALL
SDL_IdleTimerDisabledChanged(void *userdata, const char *name, const char *oldValue, const char *hint)
{
BOOL disable = (hint && *hint != '0');
[UIApplication sharedApplication].idleTimerDisabled = disable;
}
#if !TARGET_OS_TV
/* Load a launch image using the old UILaunchImageFile-era naming rules. */
static UIImage *
@@ -457,10 +450,6 @@ SDL_LoadLaunchImageNamed(NSString *name, int screenh)
/* Set working directory to resource path */
[[NSFileManager defaultManager] changeCurrentDirectoryPath:[bundle resourcePath]];
/* register a callback for the idletimer hint */
SDL_AddHintCallback(SDL_HINT_IDLE_TIMER_DISABLED,
SDL_IdleTimerDisabledChanged, NULL);
SDL_SetMainReady();
[self performSelector:@selector(postFinishLaunch) withObject:nil afterDelay:0.0];

View File

@@ -177,14 +177,10 @@ void
UIKit_SuspendScreenSaver(_THIS)
{
@autoreleasepool {
/* Ignore ScreenSaver API calls if the idle timer hint has been set. */
/* FIXME: The idle timer hint should be deprecated for SDL 2.1. */
if (!SDL_GetHintBoolean(SDL_HINT_IDLE_TIMER_DISABLED, SDL_FALSE)) {
UIApplication *app = [UIApplication sharedApplication];
UIApplication *app = [UIApplication sharedApplication];
/* Prevent the display from dimming and going to sleep. */
app.idleTimerDisabled = (_this->suspend_screensaver != SDL_FALSE);
}
/* Prevent the display from dimming and going to sleep. */
app.idleTimerDisabled = (_this->suspend_screensaver != SDL_FALSE);
}
}