From 3f53e5dadbc5900ba71799a96c82d666a4b2ea18 Mon Sep 17 00:00:00 2001 From: Sam Lantinga Date: Mon, 12 Jan 2009 08:23:12 +0000 Subject: [PATCH] Don't disable the screen saver by default for windows applications --- src/SDL_compat.c | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/src/SDL_compat.c b/src/SDL_compat.c index b928d0458..d4dd6b541 100644 --- a/src/SDL_compat.c +++ b/src/SDL_compat.c @@ -377,18 +377,20 @@ ClearVideoSurface() } static void -SetupScreenSaver() +SetupScreenSaver(int flags) { const char *env; SDL_bool allow_screensaver; - /* Allow environment override of screensaver disable */ - env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER"); - if (env) { - allow_screensaver = SDL_atoi(env) ? SDL_TRUE : SDL_FALSE; - } else { - allow_screensaver = SDL_FALSE; - } + /* Allow environment override of screensaver disable */ + env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER"); + if (env) { + allow_screensaver = SDL_atoi(env) ? SDL_TRUE : SDL_FALSE; + } else if (flags & SDL_FULLSCREEN) { + allow_screensaver = SDL_FALSE; + } else { + allow_screensaver = SDL_TRUE; + } if (allow_screensaver) { SDL_EnableScreenSaver(); } else { @@ -700,7 +702,7 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags) ClearVideoSurface(); - SetupScreenSaver(); + SetupScreenSaver(flags); /* We're finally done! */ return SDL_PublicSurface;