diff options
author | Bernhard Beschow <shentey@gmail.com> | 2024-05-12 11:59:45 +0200 |
---|---|---|
committer | Michael Tokarev <mjt@tls.msk.ru> | 2024-06-06 14:20:10 +0300 |
commit | af008b379c6e1b37b822215dc4db4e036ba6769c (patch) | |
tree | f5036b698514add9a8be1cfe6a15f17cd90371b6 | |
parent | 276ec925a7d28933be8e849177472df4c7e27d70 (diff) |
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 <shentey@gmail.com>
Acked-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Message-ID: <20240512095945.1879-1-shentey@gmail.com>
(cherry picked from commit 2e701e6785cd8cc048c608751c6e4f6253c67ab6)
Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
-rw-r--r-- | ui/sdl2.c | 1 |
1 files changed, 1 insertions, 0 deletions
@@ -874,6 +874,7 @@ static void sdl2_display_init(DisplayState *ds, DisplayOptions *o) SDL_SetHint(SDL_HINT_ALLOW_ALT_TAB_WHILE_GRABBED, "0"); #endif SDL_SetHint(SDL_HINT_WINDOWS_NO_CLOSE_ON_ALT_F4, "1"); + SDL_EnableScreenSaver(); memset(&info, 0, sizeof(info)); SDL_VERSION(&info.version); |