From: Bernhard Beschow Date: Sun, 12 May 2024 09:59:45 +0000 (+0200) Subject: ui/sdl2: Allow host to power down screen X-Git-Tag: v7.2.12~2 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=61687b3b438b8fe8bf53fbc7accfca6f8e5e7d0c;p=thirdparty%2Fqemu.git 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 Acked-by: Marc-André Lureau Message-ID: <20240512095945.1879-1-shentey@gmail.com> (cherry picked from commit 2e701e6785cd8cc048c608751c6e4f6253c67ab6) Signed-off-by: Michael Tokarev --- diff --git a/ui/sdl2.c b/ui/sdl2.c index d630459b786..fc7e8639c25 100644 --- a/ui/sdl2.c +++ b/ui/sdl2.c @@ -857,6 +857,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);