src/video/dga/SDL_dgavideo.c
changeset 1784 45669d4efd02
parent 1575 3ba88cb7eb1b
child 1785 dcec47a019e2
     1.1 --- a/src/video/dga/SDL_dgavideo.c	Mon May 08 06:38:13 2006 +0000
     1.2 +++ b/src/video/dga/SDL_dgavideo.c	Mon May 08 06:54:20 2006 +0000
     1.3 @@ -41,6 +41,11 @@
     1.4  /* get function pointers... */
     1.5  #include "../x11/SDL_x11dyn.h"
     1.6  
     1.7 +/* Heheh we're using X11 event code */
     1.8 +extern void X11_SaveScreenSaver(Display *display, int *saved_timeout, BOOL *dpms);
     1.9 +extern void X11_DisableScreenSaver(Display *display);
    1.10 +extern void X11_RestoreScreenSaver(Display *display, int saved_timeout, BOOL dpms);
    1.11 +
    1.12  /* Initialization/Query functions */
    1.13  static int DGA_VideoInit(_THIS, SDL_PixelFormat *vformat);
    1.14  static SDL_Rect **DGA_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags);
    1.15 @@ -387,6 +392,10 @@
    1.16  		return(-1);
    1.17  	}
    1.18  
    1.19 +	/* Save DPMS and screensaver settings */
    1.20 +	X11_SaveScreenSaver(DGA_Display, &screensaver_timeout, &dpms_enabled);
    1.21 +	X11_DisableScreenSaver(DGA_Display);
    1.22 +
    1.23  	/* Query for the list of available video modes */
    1.24  	modes = SDL_NAME(XDGAQueryModes)(DGA_Display, DGA_Screen, &num_modes);
    1.25  	SDL_qsort(modes, num_modes, sizeof *modes, cmpmodes);
    1.26 @@ -1048,7 +1057,6 @@
    1.27  		}
    1.28  #endif /* LOCK_DGA_DISPLAY */
    1.29  
    1.30 -
    1.31  		/* Clean up defined video modes */
    1.32  		for ( i=0; i<NUM_MODELISTS; ++i ) {
    1.33  			if ( SDL_modelist[i] != NULL ) {
    1.34 @@ -1063,6 +1071,9 @@
    1.35  		/* Clean up the memory bucket list */
    1.36  		DGA_FreeHWSurfaces(this);
    1.37  
    1.38 +		/* Restore DPMS and screensaver settings */
    1.39 +		X11_RestoreScreenSaver(DGA_Display, screensaver_timeout, dpms_enabled);
    1.40 +
    1.41  		/* Close up the display */
    1.42  		XCloseDisplay(DGA_Display);
    1.43  	}