diff --git a/docs/README-migration.md b/docs/README-migration.md index 3432b5475..7fd9d9307 100644 --- a/docs/README-migration.md +++ b/docs/README-migration.md @@ -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) diff --git a/include/SDL3/SDL_hints.h b/include/SDL3/SDL_hints.h index 7662597af..39351bbd0 100644 --- a/include/SDL3/SDL_hints.h +++ b/include/SDL3/SDL_hints.h @@ -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. * diff --git a/src/video/uikit/SDL_uikitappdelegate.m b/src/video/uikit/SDL_uikitappdelegate.m index f41ac6954..9c4e8b534 100644 --- a/src/video/uikit/SDL_uikitappdelegate.m +++ b/src/video/uikit/SDL_uikitappdelegate.m @@ -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]; diff --git a/src/video/uikit/SDL_uikitvideo.m b/src/video/uikit/SDL_uikitvideo.m index 0df6bcd8d..0ff7efe94 100644 --- a/src/video/uikit/SDL_uikitvideo.m +++ b/src/video/uikit/SDL_uikitvideo.m @@ -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); } } diff --git a/test/testautomation_hints.c b/test/testautomation_hints.c index 1b7e8de29..a3dee44af 100644 --- a/test/testautomation_hints.c +++ b/test/testautomation_hints.c @@ -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",