src/video/x11/SDL_x11video.c
branchSDL-1.2
changeset 3936 c5c3c772f5aa
parent 3885 a10bddfdc40f
child 3964 3dc92ff218dd
     1.1 --- a/src/video/x11/SDL_x11video.c	Wed Apr 04 10:34:42 2007 +0000
     1.2 +++ b/src/video/x11/SDL_x11video.c	Fri Apr 06 20:30:41 2007 +0000
     1.3 @@ -441,6 +441,7 @@
     1.4  
     1.5  static int X11_VideoInit(_THIS, SDL_PixelFormat *vformat)
     1.6  {
     1.7 +	const char *env = NULL;
     1.8  	char *display;
     1.9  	int i;
    1.10  
    1.11 @@ -546,7 +547,7 @@
    1.12  
    1.13  	/* Save DPMS and screensaver settings */
    1.14  	X11_SaveScreenSaver(SDL_Display, &screensaver_timeout, &dpms_enabled);
    1.15 -	X11_DisableScreenSaver(SDL_Display);
    1.16 +	X11_DisableScreenSaver(this, SDL_Display);
    1.17  
    1.18  	/* See if we have been passed a window to use */
    1.19  	SDL_windowid = SDL_getenv("SDL_WINDOWID");
    1.20 @@ -562,6 +563,10 @@
    1.21  	/* Fill in some window manager capabilities */
    1.22  	this->info.wm_available = 1;
    1.23  
    1.24 +	/* Allow environment override of screensaver disable. */
    1.25 +	env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER");
    1.26 +	this->hidden->allow_screensaver = ( (env && SDL_atoi(env)) ? 1 : 0 );
    1.27 +
    1.28  	/* We're done! */
    1.29  	XFlush(SDL_Display);
    1.30  	return(0);
    1.31 @@ -1375,7 +1380,7 @@
    1.32  		}
    1.33  
    1.34  		/* Restore DPMS and screensaver settings */
    1.35 -		X11_RestoreScreenSaver(SDL_Display, screensaver_timeout, dpms_enabled);
    1.36 +		X11_RestoreScreenSaver(this, SDL_Display, screensaver_timeout, dpms_enabled);
    1.37  
    1.38  		/* Free that blank cursor */
    1.39  		if ( SDL_BlankCursor != NULL ) {