Skip to content

Commit 453a7c4

Browse files
shentokMichael Tokarev
authored andcommitted
ui/sdl2: Allow host to power down screen
By default, SDL disables the screen saver which prevents the host from powering down the screen even if the screen is locked. This results in draining the battery needlessly when the host isn't connected to a wall charger. Fix that by enabling the screen saver. Signed-off-by: Bernhard Beschow <[email protected]> Acked-by: Marc-André Lureau <[email protected]> Message-ID: <[email protected]> (cherry picked from commit 2e701e6) Signed-off-by: Michael Tokarev <[email protected]>
1 parent 3fe6774 commit 453a7c4

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

ui/sdl2.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -874,6 +874,7 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o)
874874
SDL_SetHint(SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED, "0");
875875
#endif
876876
SDL_SetHint(SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4, "1");
877+
SDL_EnableScreenSaver();
877878
memset(&info, 0, sizeof(info));
878879
SDL_VERSION(&info.version);
879880

0 commit comments

Comments
 (0)