Don't disable the screen saver by default for windows applications
authorSam Lantinga <slouken@libsdl.org>
Mon, 12 Jan 2009 08:23:12 +0000
changeset 3028 1c4a059966bd
parent 3027 61225d2834a3
child 3029 89f8a72e1ee9
Don't disable the screen saver by default for windows applications
src/SDL_compat.c
--- a/src/SDL_compat.c	Mon Jan 12 06:22:26 2009 +0000
+++ b/src/SDL_compat.c	Mon Jan 12 08:23:12 2009 +0000
@@ -377,18 +377,20 @@
 }
 
 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 @@
 
     ClearVideoSurface();
 
-    SetupScreenSaver();
+    SetupScreenSaver(flags);
 
     /* We're finally done! */
     return SDL_PublicSurface;