From 1727c7726bcc7e51dc2972f3ebc10f18aca8bc19 Mon Sep 17 00:00:00 2001 From: Netboy3 <1472804+netboy3@users.noreply.github.com> Date: Sat, 9 Jan 2021 11:36:56 -0500 Subject: [PATCH] [client] fix screensaver enable The hint "SDL_HINT_VIDEO_ALLOW_SCREENSAVER" only works if set before SDL_Init(). Move it to the proper location. --- client/src/main.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/client/src/main.c b/client/src/main.c index c9824cd6..3205c0a3 100644 --- a/client/src/main.c +++ b/client/src/main.c @@ -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);