Don't disable the screen saver by default for windows applications
--HG-- extra : convert_revision : svn%3Ac70aab31-4412-0410-b14c-859654838e24/trunk%403490
This commit is contained in:
parent
3c5fca041a
commit
92091bf9b8
1 changed files with 11 additions and 9 deletions
|
@ -377,18 +377,20 @@ ClearVideoSurface()
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
SetupScreenSaver()
|
SetupScreenSaver(int flags)
|
||||||
{
|
{
|
||||||
const char *env;
|
const char *env;
|
||||||
SDL_bool allow_screensaver;
|
SDL_bool allow_screensaver;
|
||||||
|
|
||||||
/* Allow environment override of screensaver disable */
|
/* Allow environment override of screensaver disable */
|
||||||
env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER");
|
env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER");
|
||||||
if (env) {
|
if (env) {
|
||||||
allow_screensaver = SDL_atoi(env) ? SDL_TRUE : SDL_FALSE;
|
allow_screensaver = SDL_atoi(env) ? SDL_TRUE : SDL_FALSE;
|
||||||
} else {
|
} else if (flags & SDL_FULLSCREEN) {
|
||||||
allow_screensaver = SDL_FALSE;
|
allow_screensaver = SDL_FALSE;
|
||||||
}
|
} else {
|
||||||
|
allow_screensaver = SDL_TRUE;
|
||||||
|
}
|
||||||
if (allow_screensaver) {
|
if (allow_screensaver) {
|
||||||
SDL_EnableScreenSaver();
|
SDL_EnableScreenSaver();
|
||||||
} else {
|
} else {
|
||||||
|
@ -700,7 +702,7 @@ SDL_SetVideoMode(int width, int height, int bpp, Uint32 flags)
|
||||||
|
|
||||||
ClearVideoSurface();
|
ClearVideoSurface();
|
||||||
|
|
||||||
SetupScreenSaver();
|
SetupScreenSaver(flags);
|
||||||
|
|
||||||
/* We're finally done! */
|
/* We're finally done! */
|
||||||
return SDL_PublicSurface;
|
return SDL_PublicSurface;
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue