src/video/quartz/SDL_QuartzVideo.m
branchSDL-1.2
changeset 4139 568c9b3c0167
parent 4123 9d90d7765fa7
child 4159 a1b03ba2fcd0
--- a/src/video/quartz/SDL_QuartzVideo.m	Tue Feb 26 10:50:28 2008 +0000
+++ b/src/video/quartz/SDL_QuartzVideo.m	Fri Feb 29 13:55:44 2008 +0000
@@ -188,8 +188,17 @@
     mode_list  = CGDisplayAvailableModes (display_id);
     palette    = CGPaletteCreateDefaultColorPalette ();
 
+    /* Allow environment override of screensaver disable. */
     env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER");
-    allow_screensaver = ( env && SDL_atoi(env) ) ? YES : NO;
+    if ( env ) {
+        allow_screensaver = SDL_atoi(env);
+    } else {
+#ifdef SDL_VIDEO_DISABLE_SCREENSAVER
+        allow_screensaver = 0;
+#else
+        allow_screensaver = 1;
+#endif
+    }
 
     /* Gather some information that is useful to know about the display */
     CFNumberGetValue (CFDictionaryGetValue (save_mode, kCGDisplayBitsPerPixel),