[client] displayserver: move screensaver handling into displayservers

This also makes Wayland idle inhibition respect noScreensaver setting.
This commit is contained in:
Quantum
2021-01-18 16:08:38 -05:00
committed by Geoffrey McRae
parent 44a949f5c6
commit 2f11024db8
5 changed files with 33 additions and 8 deletions

View File

@@ -1816,6 +1816,8 @@ static int lg_run(void)
SET_FALLBACK(ungrabKeyboard);
SET_FALLBACK(warpPointer);
SET_FALLBACK(realignPointer);
SET_FALLBACK(inhibitIdle);
SET_FALLBACK(uninhibitIdle);
SET_FALLBACK(cbInit);
SET_FALLBACK(cbNotice);
SET_FALLBACK(cbRelease);
@@ -1829,8 +1831,8 @@ static int lg_run(void)
return -1;
}
if (!params.noScreensaver)
SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1");
// Allow screensavers for now: we will enable and disable as needed.
SDL_SetHint(SDL_HINT_VIDEO_ALLOW_SCREENSAVER, "1");
if (SDL_Init(SDL_INIT_VIDEO) < 0)
{
@@ -1961,6 +1963,9 @@ static int lg_run(void)
if (!params.center)
SDL_SetWindowPosition(g_state.window, params.x, params.y);
if (!params.noScreensaver)
g_state.ds->inhibitIdle();
// ensure the initial window size is stored in the state
SDL_GetWindowSize(g_state.window, &g_state.windowW, &g_state.windowH);