src/video/x11/SDL_x11events.c
changeset 1784 45669d4efd02
parent 1783 c546353b1ad4
child 1789 01313c1a2bbe
     1.1 --- a/src/video/x11/SDL_x11events.c	Mon May 08 06:38:13 2006 +0000
     1.2 +++ b/src/video/x11/SDL_x11events.c	Mon May 08 06:54:20 2006 +0000
     1.3 @@ -1118,53 +1118,53 @@
     1.4  	X11_InitKeymap();
     1.5  }
     1.6  
     1.7 -void X11_SaveScreenSaver(_THIS)
     1.8 +void X11_SaveScreenSaver(Display *display, int *saved_timeout, BOOL *dpms)
     1.9  {
    1.10  	int timeout, interval, prefer_blank, allow_exp;
    1.11 -	XGetScreenSaver(SDL_Display, &timeout, &interval, &prefer_blank, &allow_exp);
    1.12 -	screensaver_timeout = timeout;
    1.13 +	XGetScreenSaver(display, &timeout, &interval, &prefer_blank, &allow_exp);
    1.14 +	*saved_timeout = timeout;
    1.15  
    1.16  #if SDL_VIDEO_DRIVER_X11_DPMS
    1.17  	if ( SDL_X11_HAVE_DPMS ) {
    1.18  		int dummy;
    1.19 -	  	if ( DPMSQueryExtension(SDL_Display, &dummy, &dummy) ) {
    1.20 +	  	if ( DPMSQueryExtension(display, &dummy, &dummy) ) {
    1.21  			CARD16 state;
    1.22 -			DPMSInfo(SDL_Display, &state, &dpms_enabled);
    1.23 +			DPMSInfo(display, &state, dpms);
    1.24  		}
    1.25  	}
    1.26  #endif /* SDL_VIDEO_DRIVER_X11_DPMS */
    1.27  }
    1.28  
    1.29 -void X11_DisableScreenSaver(_THIS)
    1.30 +void X11_DisableScreenSaver(Display *display)
    1.31  {
    1.32  	int timeout, interval, prefer_blank, allow_exp;
    1.33 -	XGetScreenSaver(SDL_Display, &timeout, &interval, &prefer_blank, &allow_exp);
    1.34 +	XGetScreenSaver(display, &timeout, &interval, &prefer_blank, &allow_exp);
    1.35  	timeout = 0;
    1.36 -	XSetScreenSaver(SDL_Display, timeout, interval, prefer_blank, allow_exp);
    1.37 +	XSetScreenSaver(display, timeout, interval, prefer_blank, allow_exp);
    1.38  
    1.39  #if SDL_VIDEO_DRIVER_X11_DPMS
    1.40  	if ( SDL_X11_HAVE_DPMS ) {
    1.41  		int dummy;
    1.42 -	  	if ( DPMSQueryExtension(SDL_Display, &dummy, &dummy) ) {
    1.43 -			DPMSDisable(SDL_Display);
    1.44 +	  	if ( DPMSQueryExtension(display, &dummy, &dummy) ) {
    1.45 +			DPMSDisable(display);
    1.46  		}
    1.47  	}
    1.48  #endif /* SDL_VIDEO_DRIVER_X11_DPMS */
    1.49  }
    1.50  
    1.51 -void X11_RestoreScreenSaver(_THIS)
    1.52 +void X11_RestoreScreenSaver(Display *display, int saved_timeout, BOOL dpms)
    1.53  {
    1.54  	int timeout, interval, prefer_blank, allow_exp;
    1.55 -	XGetScreenSaver(SDL_Display, &timeout, &interval, &prefer_blank, &allow_exp);
    1.56 -	timeout = screensaver_timeout;
    1.57 -	XSetScreenSaver(SDL_Display, timeout, interval, prefer_blank, allow_exp);
    1.58 +	XGetScreenSaver(display, &timeout, &interval, &prefer_blank, &allow_exp);
    1.59 +	timeout = saved_timeout;
    1.60 +	XSetScreenSaver(display, timeout, interval, prefer_blank, allow_exp);
    1.61  
    1.62  #if SDL_VIDEO_DRIVER_X11_DPMS
    1.63  	if ( SDL_X11_HAVE_DPMS ) {
    1.64  		int dummy;
    1.65 -	  	if ( DPMSQueryExtension(SDL_Display, &dummy, &dummy) ) {
    1.66 -			if ( dpms_enabled ) {
    1.67 -				DPMSEnable(SDL_Display);
    1.68 +	  	if ( DPMSQueryExtension(display, &dummy, &dummy) ) {
    1.69 +			if ( dpms ) {
    1.70 +				DPMSEnable(display);
    1.71  			}
    1.72  		}
    1.73  	}