Fixed bug #510 SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Sat, 29 Dec 2007 21:41:48 +0000
branchSDL-1.2
changeset 4124df2f562890a0
parent 4123 9d90d7765fa7
child 4125 21d48dbc2ca8
Fixed bug #510

Oops, we were disabling the screensaver before checking SDL_VIDEO_ALLOW_SCREENSAVER
src/video/x11/SDL_x11video.c
     1.1 --- a/src/video/x11/SDL_x11video.c	Sat Dec 29 21:31:26 2007 +0000
     1.2 +++ b/src/video/x11/SDL_x11video.c	Sat Dec 29 21:41:48 2007 +0000
     1.3 @@ -667,6 +667,10 @@
     1.4  	}
     1.5  	X11_SaveVidModeGamma(this);
     1.6  
     1.7 +	/* Allow environment override of screensaver disable. */
     1.8 +	env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER");
     1.9 +	this->hidden->allow_screensaver = ( (env && SDL_atoi(env)) ? 1 : 0 );
    1.10 +
    1.11  	/* Save DPMS and screensaver settings */
    1.12  	X11_SaveScreenSaver(SDL_Display, &screensaver_timeout, &dpms_enabled);
    1.13  	X11_DisableScreenSaver(this, SDL_Display);
    1.14 @@ -685,10 +689,6 @@
    1.15  	/* Fill in some window manager capabilities */
    1.16  	this->info.wm_available = 1;
    1.17  
    1.18 -	/* Allow environment override of screensaver disable. */
    1.19 -	env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER");
    1.20 -	this->hidden->allow_screensaver = ( (env && SDL_atoi(env)) ? 1 : 0 );
    1.21 -
    1.22  	/* We're done! */
    1.23  	XFlush(SDL_Display);
    1.24  	return(0);