summaryrefslogtreecommitdiff
path: root/sdl.c
diff options
context:
space:
mode:
authorJan Kiszka <jan.kiszka@siemens.com>2010-05-23 10:29:34 +0200
committerAnthony Liguori <aliguori@us.ibm.com>2010-05-24 15:18:23 -0500
commit111f8ec99b67aeef152c71a5db12f0c0cb2422bd (patch)
tree86abac4250387d9ef5cdcbc89c4b463fec361cd6 /sdl.c
parent9c678ccd15e71968ba9ce3cba704f429c5c7d539 (diff)
downloadqemu-111f8ec99b67aeef152c71a5db12f0c0cb2422bd.tar.gz
sdl: Do not disable screensaver by default
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>
Diffstat (limited to 'sdl.c')
-rw-r--r--sdl.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/sdl.c b/sdl.c
index 16a48e92cb..3bdd518d26 100644
--- 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",