[client] fix screensaver enable

The hint "SDL_HINT_VIDEO_ALLOW_SCREENSAVER" only works if set
before SDL_Init(). Move it to the proper location.
This commit is contained in:
Netboy3 authored and Geoffrey McRae committed 2021-01-10 13:43:57 +11:00
1 parent 0b890ed1ac
commit 1727c7726b
1 file changed
+3 -6
+3 -6
View File
@@ -1840,6 +1840,9 @@ static int lg_run()
}
}
if (!params.noScreensaver)
SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1");
if (SDL_Init(SDL_INIT_VIDEO) < 0)
{
DEBUG_ERROR("SDL_Init Failed");
@@ -1954,12 +1957,6 @@ static int lg_run()
if (params.fullscreen)
SDL_SetWindowFullscreen(g_state.window, SDL_WINDOW_FULLSCREEN_DESKTOP);
if (!params.noScreensaver)
{
SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1");
SDL_EnableScreenSaver();
}
if (!params.center)
SDL_SetWindowPosition(g_state.window, params.x, params.y);