Fixed bug #510 SDL-1.2
authorSam Lantinga <slouken@libsdl.org>
Sat, 29 Dec 2007 21:41:48 +0000
branchSDL-1.2
changeset 4124 df2f562890a0
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
--- a/src/video/x11/SDL_x11video.c	Sat Dec 29 21:31:26 2007 +0000
+++ b/src/video/x11/SDL_x11video.c	Sat Dec 29 21:41:48 2007 +0000
@@ -667,6 +667,10 @@
 	}
 	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);
@@ -685,10 +689,6 @@
 	/* 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);