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

@ -169,6 +169,7 @@ Programs which have access to shaders can implement more robust versions of thos
## SDL_hints.h
The following hints have been removed:
* SDL_HINT_IDLE_TIMER_DISABLED (use SDL_DisableScreenSaver instead)
* SDL_HINT_VIDEO_X11_FORCE_EGL (use SDL_HINT_VIDEO_FORCE_EGL instead)
* SDL_HINT_VIDEO_X11_XINERAMA (Xinerama no longer supported by the X11 backend)
* SDL_HINT_VIDEO_X11_XVIDMODE (Xvidmode no longer supported by the X11 backend)

View File

@ -556,23 +556,6 @@ extern "C" {
*/
#define SDL_HINT_HIDAPI_IGNORE_DEVICES "SDL_HIDAPI_IGNORE_DEVICES"
/**
* \brief A variable controlling whether the idle timer is disabled on iOS.
*
* When an iOS app does not receive touches for some time, the screen is
* dimmed automatically. For games where the accelerometer is the only input
* this is problematic. This functionality can be disabled by setting this
* hint.
*
* As of SDL 2.0.4, SDL_EnableScreenSaver() and SDL_DisableScreenSaver()
* accomplish the same thing on iOS. They should be preferred over this hint.
*
* This variable can be set to the following values:
* "0" - Enable idle timer
* "1" - Disable idle timer
*/
#define SDL_HINT_IDLE_TIMER_DISABLED "SDL_IOS_IDLE_TIMER_DISABLED"
/**
* \brief A variable to control whether certain IMEs should handle text editing internally instead of sending SDL_TEXTEDITING events.
*

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);
}
}

View File

@ -12,7 +12,6 @@ const char* _HintsEnum[] =
SDL_HINT_FRAMEBUFFER_ACCELERATION,
SDL_HINT_GAMECONTROLLERCONFIG,
SDL_HINT_GRAB_KEYBOARD,
SDL_HINT_IDLE_TIMER_DISABLED,
SDL_HINT_JOYSTICK_ALLOW_BACKGROUND_EVENTS,
SDL_HINT_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK,
SDL_HINT_MOUSE_RELATIVE_MODE_WARP,
@ -38,7 +37,6 @@ const char* _HintsVerbose[] =
"SDL_FRAMEBUFFER_ACCELERATION",
"SDL_GAMECONTROLLERCONFIG",
"SDL_GRAB_KEYBOARD",
"SDL_IDLE_TIMER_DISABLED",
"SDL_JOYSTICK_ALLOW_BACKGROUND_EVENTS",
"SDL_MAC_CTRL_CLICK_EMULATE_RIGHT_CLICK",
"SDL_MOUSE_RELATIVE_MODE_WARP",