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 30281c4a059966bd
parent 3027 61225d2834a3
child 3029 89f8a72e1ee9
Don't disable the screen saver by default for windows applications
src/SDL_compat.c
     1.1 --- a/src/SDL_compat.c	Mon Jan 12 06:22:26 2009 +0000
     1.2 +++ b/src/SDL_compat.c	Mon Jan 12 08:23:12 2009 +0000
     1.3 @@ -377,18 +377,20 @@
     1.4  }
     1.5  
     1.6  static void
     1.7 -SetupScreenSaver()
     1.8 +SetupScreenSaver(int flags)
     1.9  {
    1.10      const char *env;
    1.11      SDL_bool allow_screensaver;
    1.12  
    1.13 -	/* Allow environment override of screensaver disable */
    1.14 -	env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER");
    1.15 -	if (env) {
    1.16 -		allow_screensaver = SDL_atoi(env) ? SDL_TRUE : SDL_FALSE;
    1.17 -	} else {
    1.18 -		allow_screensaver = SDL_FALSE;
    1.19 -	}
    1.20 +    /* Allow environment override of screensaver disable */
    1.21 +    env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER");
    1.22 +    if (env) {
    1.23 +        allow_screensaver = SDL_atoi(env) ? SDL_TRUE : SDL_FALSE;
    1.24 +    } else if (flags & SDL_FULLSCREEN) {
    1.25 +        allow_screensaver = SDL_FALSE;
    1.26 +    } else {
    1.27 +        allow_screensaver = SDL_TRUE;
    1.28 +    }
    1.29      if (allow_screensaver) {
    1.30          SDL_EnableScreenSaver();
    1.31      } else {
    1.32 @@ -700,7 +702,7 @@
    1.33  
    1.34      ClearVideoSurface();
    1.35  
    1.36 -    SetupScreenSaver();
    1.37 +    SetupScreenSaver(flags);
    1.38  
    1.39      /* We're finally done! */
    1.40      return SDL_PublicSurface;