From 92091bf9b8d4bdc842672f32e0656dca12a27ef1 Mon Sep 17 00:00:00 2001
From: Sam Lantinga <slouken@libsdl.org>
Date: Mon, 12 Jan 2009 08:23:12 +0000
Subject: [PATCH] Don't disable the screen saver by default for windows
 applications

--HG--
extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403490
---
 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 b928d045..d4dd6b54 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;
-- 
2.18.1