Skip to content

Commit

Permalink
Fixed bug #510
Browse files Browse the repository at this point in the history
Oops, we were disabling the screensaver before checking SDL_VIDEO_ALLOW_SCREENSAVER
  • Loading branch information
slouken committed Dec 29, 2007
1 parent 6fb1c7b commit 31f73f2
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/video/x11/SDL_x11video.c
Expand Up @@ -667,6 +667,10 @@ static int X11_VideoInit(_THIS, SDL_PixelFormat *vformat)
}
X11_SaveVidModeGamma(this);

/* Allow environment override of screensaver disable. */
env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER");
this->hidden->allow_screensaver = ( (env && SDL_atoi(env)) ? 1 : 0 );

/* Save DPMS and screensaver settings */
X11_SaveScreenSaver(SDL_Display, &screensaver_timeout, &dpms_enabled);
X11_DisableScreenSaver(this, SDL_Display);
Expand All @@ -685,10 +689,6 @@ static int X11_VideoInit(_THIS, SDL_PixelFormat *vformat)
/* Fill in some window manager capabilities */
this->info.wm_available = 1;

/* Allow environment override of screensaver disable. */
env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER");
this->hidden->allow_screensaver = ( (env && SDL_atoi(env)) ? 1 : 0 );

/* We're done! */
XFlush(SDL_Display);
return(0);
Expand Down

0 comments on commit 31f73f2

Please sign in to comment.