[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 2021-01-09 11:36:56 -05:00 committed by Geoffrey McRae
parent 0b890ed1ac
commit 1727c7726b

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