]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
sdl: Do not disable screensaver by default
authorJan Kiszka <jan.kiszka@siemens.com>
Sun, 23 May 2010 08:29:34 +0000 (10:29 +0200)
committerAnthony Liguori <aliguori@us.ibm.com>
Mon, 24 May 2010 20:18:23 +0000 (15:18 -0500)
Unless we are running in full-screen mode, QEMU's SDL window should not
disable the host's screensaver. The user can still change this behaviour
by setting the environment variable SDL_VIDEO_ALLOW_SCREENSAVER as
desired.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
sdl.c

diff --git a/sdl.c b/sdl.c
index 16a48e92cb7f3ef3c92c12870d9359154cdd0301..3bdd518d26cc653aad41a5f8a1ca8f370ffcb723 100644 (file)
--- a/sdl.c
+++ b/sdl.c
@@ -855,6 +855,10 @@ void sdl_display_init(DisplayState *ds, int full_screen, int no_frame)
     if (no_frame)
         gui_noframe = 1;
 
+    if (!full_screen) {
+        setenv("SDL_VIDEO_ALLOW_SCREENSAVER", "1", 0);
+    }
+
     flags = SDL_INIT_VIDEO | SDL_INIT_NOPARACHUTE;
     if (SDL_Init (flags)) {
         fprintf(stderr, "Could not initialize SDL(%s) - exiting\n",