mirror of
https://git.code.sf.net/p/quake/quakeforge
synced 2024-11-10 23:32:09 +00:00
bring back the screen saver code
This commit is contained in:
parent
341b6a1d68
commit
c5eb7d6e94
1 changed files with 22 additions and 0 deletions
|
@ -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);
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue