bring back the screen saver code

This commit is contained in:
Bill Currie 2003-01-16 21:44:42 +00:00
parent 341b6a1d68
commit c5eb7d6e94

View file

@ -108,6 +108,11 @@ qboolean vid_fullscreen_active;
static qboolean vid_context_created = false;
static int window_x, window_y, window_saved;
static int xss_timeout;
static int xss_interval;
static int xss_blanking;
static int xss_exposures;
qboolean
X11_AddEvent (int event, void (*event_handler) (XEvent *))
@ -361,6 +366,7 @@ X11_SetVidMode (int width, int height)
vidmodes[best_mode]);
X11_ForceViewPort ();
vidmode_active = true;
X11_SetScreenSaver ();
} else {
Con_Printf ("VID: Mode %dx%d can't go fullscreen.\n",
vid.width, vid.height);
@ -498,6 +504,7 @@ X11_RestoreVidMode (void)
{
#ifdef HAVE_VIDMODE
if (vidmode_active) {
X11_RestoreScreenSaver ();
XF86VidModeSwitchToMode (x_disp, x_screen, vidmodes[original_mode]);
XFree (vidmodes);
vidmode_active = false;
@ -685,3 +692,18 @@ X11_RestoreGamma (void)
# endif
#endif
}
void
X11_SetScreenSaver (void)
{
XGetScreenSaver (x_disp, &xss_timeout, &xss_interval, &xss_blanking,
&xss_exposures);
XSetScreenSaver (x_disp, 0, xss_interval, xss_blanking, xss_exposures);
}
void
X11_RestoreScreenSaver (void)
{
XSetScreenSaver (x_disp, xss_timeout, xss_interval, xss_blanking,
xss_exposures);
}