Mercurial > sdl-ios-xcode
changeset 3028:1c4a059966bd
Don't disable the screen saver by default for windows applications
author | Sam Lantinga <slouken@libsdl.org> |
---|---|
date | Mon, 12 Jan 2009 08:23:12 +0000 |
parents | 61225d2834a3 |
children | 89f8a72e1ee9 |
files | src/SDL_compat.c |
diffstat | 1 files changed, 11 insertions(+), 9 deletions(-) [+] |
line wrap: on
line diff
--- 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;