Skip to content
This repository has been archived by the owner on Feb 11, 2021. It is now read-only.

Commit

Permalink
Don't disable the screen saver by default for windows applications
Browse files Browse the repository at this point in the history
  • Loading branch information
slouken committed Jan 12, 2009
1 parent d188238 commit 3f53e5d
Showing 1 changed file with 11 additions and 9 deletions.
20 changes: 11 additions & 9 deletions src/SDL_compat.c
Expand Up @@ -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 {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit 3f53e5d

Please sign in to comment.