diff --git a/configure.in b/configure.in index 287e22434..252bdbda4 100644 --- a/configure.in +++ b/configure.in @@ -1090,19 +1090,6 @@ AC_HELP_STRING([--enable-video-x11-xrandr], [enable X11 Xrandr extension for ful if test x$definitely_enable_video_x11_xrandr = xyes; then AC_DEFINE(SDL_VIDEO_DRIVER_X11_XRANDR) fi - AC_ARG_ENABLE(video-x11-dpms, -AC_HELP_STRING([--enable-video-x11-dpms], [enable X11 DPMS extension [[default=yes]]]), - , enable_video_x11_dpms=yes) - if test x$enable_video_x11_dpms = xyes; then - AC_CHECK_HEADER(X11/extensions/dpms.h, - have_dpms_h_hdr=yes, - have_dpms_h_hdr=no, - [#include - ]) - if test x$have_dpms_h_hdr = xyes; then - AC_DEFINE(SDL_VIDEO_DRIVER_X11_DPMS) - fi - fi fi fi } @@ -1673,6 +1660,13 @@ AC_HELP_STRING([--enable-osmesa-shared], [dynamically load OSMesa OpenGL support fi } +AC_ARG_ENABLE(screensaver, +AC_HELP_STRING([--enable-screensaver], [enable screensaver by default while any SDL application is running [[default=no]]]), + , enable_screensaver=no) +if test x$enable_screensaver = xno; then + AC_DEFINE(SDL_VIDEO_DISABLE_SCREENSAVER) +fi + dnl See if we can use the new unified event interface in Linux 2.4 CheckInputEvents() { diff --git a/docs.html b/docs.html index d2c50aaa4..7c7b4f2a5 100644 --- a/docs.html +++ b/docs.html @@ -14,6 +14,45 @@ The latest stable release may be found on the

API Documentation

+

SDL 1.2.14 Release Notes

+

+SDL 1.2.14 is a minor bug fix release. +

+ +

General Notes

+ +
+

+

+
+ +

Unix Notes

+ +
+

+ Added configure option --enable-screensaver, to allow enabling the screensaver by default. +

+

+ Use XResetScreenSaver() instead of disabling screensaver entirely. +

+
+ +

Windows Notes

+ +
+

+

+
+ +

Mac OS X Notes

+ +
+

+

+
+ +[separator] +

SDL 1.2.13 Release Notes

SDL 1.2.13 is a minor bug fix release. diff --git a/include/SDL_config.h.in b/include/SDL_config.h.in index fb49c0e2f..332cb9775 100644 --- a/include/SDL_config.h.in +++ b/include/SDL_config.h.in @@ -279,7 +279,6 @@ #undef SDL_VIDEO_DRIVER_WSCONS #undef SDL_VIDEO_DRIVER_X11 #undef SDL_VIDEO_DRIVER_X11_DGAMOUSE -#undef SDL_VIDEO_DRIVER_X11_DPMS #undef SDL_VIDEO_DRIVER_X11_DYNAMIC #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XEXT #undef SDL_VIDEO_DRIVER_X11_DYNAMIC_XRANDR @@ -298,6 +297,9 @@ #undef SDL_VIDEO_OPENGL_OSMESA #undef SDL_VIDEO_OPENGL_OSMESA_DYNAMIC +/* Disable screensaver */ +#undef SDL_VIDEO_DISABLE_SCREENSAVER + /* Enable assembly routines */ #undef SDL_ASSEMBLY_ROUTINES #undef SDL_HERMES_BLITTERS diff --git a/include/SDL_config_macosx.h b/include/SDL_config_macosx.h index 481c22edc..2de52c6b5 100644 --- a/include/SDL_config_macosx.h +++ b/include/SDL_config_macosx.h @@ -126,6 +126,9 @@ /* Enable OpenGL support */ #define SDL_VIDEO_OPENGL 1 +/* Disable screensaver */ +#define SDL_VIDEO_DISABLE_SCREENSAVER 1 + /* Enable assembly routines */ #define SDL_ASSEMBLY_ROUTINES 1 #ifdef __ppc__ diff --git a/include/SDL_config_win32.h b/include/SDL_config_win32.h index cfb44d2a0..37fe11a73 100644 --- a/include/SDL_config_win32.h +++ b/include/SDL_config_win32.h @@ -172,6 +172,9 @@ typedef unsigned int uintptr_t; #define SDL_VIDEO_OPENGL_WGL 1 #endif +/* Disable screensaver */ +#define SDL_VIDEO_DISABLE_SCREENSAVER 1 + /* Enable assembly routines (Win64 doesn't have inline asm) */ #ifndef _WIN64 #define SDL_ASSEMBLY_ROUTINES 1 diff --git a/src/video/dga/SDL_dgaevents.c b/src/video/dga/SDL_dgaevents.c index 11bd21efa..c74c9ce2b 100644 --- a/src/video/dga/SDL_dgaevents.c +++ b/src/video/dga/SDL_dgaevents.c @@ -137,9 +137,21 @@ void DGA_PumpEvents(_THIS) { /* Keep processing pending events */ LOCK_DISPLAY(); + + /* Update activity every five seconds to prevent screensaver. --ryan. */ + if (!allow_screensaver) { + static Uint32 screensaverTicks; + Uint32 nowTicks = SDL_GetTicks(); + if ((nowTicks - screensaverTicks) > 5000) { + XResetScreenSaver(DGA_Display); + screensaverTicks = nowTicks; + } + } + while ( X11_Pending(DGA_Display) ) { DGA_DispatchEvent(this); } + UNLOCK_DISPLAY(); } diff --git a/src/video/dga/SDL_dgavideo.c b/src/video/dga/SDL_dgavideo.c index 331fcd260..cb9f8591c 100644 --- a/src/video/dga/SDL_dgavideo.c +++ b/src/video/dga/SDL_dgavideo.c @@ -43,11 +43,6 @@ /*#define DGA_DEBUG*/ -/* Heheh we're using X11 event code */ -extern void X11_SaveScreenSaver(Display *display, int *saved_timeout, BOOL *dpms); -extern void X11_DisableScreenSaver(Display *display); -extern void X11_RestoreScreenSaver(Display *display, int saved_timeout, BOOL dpms); - /* Initialization/Query functions */ static int DGA_VideoInit(_THIS, SDL_PixelFormat *vformat); static SDL_Rect **DGA_ListModes(_THIS, SDL_PixelFormat *format, Uint32 flags); @@ -333,6 +328,7 @@ static void UpdateHWInfo(_THIS, SDL_NAME(XDGAMode) *mode) static int DGA_VideoInit(_THIS, SDL_PixelFormat *vformat) { + const char *env; const char *display; int event_base, error_base; int major_version, minor_version; @@ -401,9 +397,17 @@ static int DGA_VideoInit(_THIS, SDL_PixelFormat *vformat) return(-1); } - /* Save DPMS and screensaver settings */ - X11_SaveScreenSaver(DGA_Display, &screensaver_timeout, &dpms_enabled); - X11_DisableScreenSaver(DGA_Display); + /* Allow environment override of screensaver disable. */ + env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER"); + if ( env ) { + allow_screensaver = SDL_atoi(env); + } else { +#ifdef SDL_VIDEO_DISABLE_SCREENSAVER + allow_screensaver = 0; +#else + allow_screensaver = 1; +#endif + } /* Query for the list of available video modes */ modes = SDL_NAME(XDGAQueryModes)(DGA_Display, DGA_Screen, &num_modes); @@ -1091,9 +1095,6 @@ void DGA_VideoQuit(_THIS) /* Clean up the memory bucket list */ DGA_FreeHWSurfaces(this); - /* Restore DPMS and screensaver settings */ - X11_RestoreScreenSaver(DGA_Display, screensaver_timeout, dpms_enabled); - /* Close up the display */ XCloseDisplay(DGA_Display); } diff --git a/src/video/dga/SDL_dgavideo.h b/src/video/dga/SDL_dgavideo.h index a0915da58..9af6f6ba1 100644 --- a/src/video/dga/SDL_dgavideo.h +++ b/src/video/dga/SDL_dgavideo.h @@ -32,10 +32,6 @@ #include "SDL_mutex.h" #include "../SDL_sysvideo.h" -#if SDL_VIDEO_DRIVER_X11_DPMS -#include -#endif - /* Hidden "this" pointer for the video functions */ #define _THIS SDL_VideoDevice *this @@ -94,9 +90,9 @@ struct SDL_PrivateVideoData { #endif /* Screensaver settings */ - int screensaver_timeout; - BOOL dpms_enabled; + int allow_screensaver; }; + /* Old variable names */ #define DGA_Display (this->hidden->DGA_Display) #define DGA_Screen DefaultScreen(DGA_Display) @@ -117,7 +113,6 @@ struct SDL_PrivateVideoData { #define hw_lock (this->hidden->hw_lock) #define DGA_event_base (this->hidden->event_base) #define event_lock (this->hidden->event_lock) -#define screensaver_timeout (this->hidden->screensaver_timeout) -#define dpms_enabled (this->hidden->dpms_enabled) +#define allow_screensaver (this->hidden->allow_screensaver) #endif /* _SDL_dgavideo_h */ diff --git a/src/video/quartz/SDL_QuartzEvents.m b/src/video/quartz/SDL_QuartzEvents.m index c20f58dd3..ada888973 100644 --- a/src/video/quartz/SDL_QuartzEvents.m +++ b/src/video/quartz/SDL_QuartzEvents.m @@ -717,8 +717,6 @@ static int QZ_OtherMouseButtonToSDL(int button) void QZ_PumpEvents (_THIS) { - static Uint32 screensaverTicks = 0; - Uint32 nowTicks; CGMouseDelta dx, dy; NSDate *distantPast; @@ -731,7 +729,8 @@ void QZ_PumpEvents (_THIS) /* Update activity every five seconds to prevent screensaver. --ryan. */ if (!allow_screensaver) { - nowTicks = SDL_GetTicks(); + static Uint32 screensaverTicks; + Uint32 nowTicks = SDL_GetTicks(); if ((nowTicks - screensaverTicks) > 5000) { UpdateSystemActivity(UsrActivity); diff --git a/src/video/quartz/SDL_QuartzVideo.m b/src/video/quartz/SDL_QuartzVideo.m index 3aff6e894..51a376ad2 100644 --- a/src/video/quartz/SDL_QuartzVideo.m +++ b/src/video/quartz/SDL_QuartzVideo.m @@ -188,8 +188,17 @@ static int QZ_VideoInit (_THIS, SDL_PixelFormat *video_format) { mode_list = CGDisplayAvailableModes (display_id); palette = CGPaletteCreateDefaultColorPalette (); + /* Allow environment override of screensaver disable. */ env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER"); - allow_screensaver = ( env && SDL_atoi(env) ) ? YES : NO; + if ( env ) { + allow_screensaver = SDL_atoi(env); + } else { +#ifdef SDL_VIDEO_DISABLE_SCREENSAVER + allow_screensaver = 0; +#else + allow_screensaver = 1; +#endif + } /* Gather some information that is useful to know about the display */ CFNumberGetValue (CFDictionaryGetValue (save_mode, kCGDisplayBitsPerPixel), diff --git a/src/video/windib/SDL_dibevents.c b/src/video/windib/SDL_dibevents.c index 254ba80f2..8b93a334d 100644 --- a/src/video/windib/SDL_dibevents.c +++ b/src/video/windib/SDL_dibevents.c @@ -227,7 +227,7 @@ LRESULT DIB_HandleMessage(_THIS, HWND hwnd, UINT msg, WPARAM wParam, LPARAM lPar case WM_SYSCOMMAND: { const DWORD val = (DWORD) (wParam & 0xFFF0); if ((val == SC_SCREENSAVE) || (val == SC_MONITORPOWER)) { - if (!this->hidden->allow_screensaver) { + if (!allow_screensaver) { /* Note that this doesn't stop anything on Vista if the screensaver has a password. */ return(0); diff --git a/src/video/windib/SDL_dibvideo.c b/src/video/windib/SDL_dibvideo.c index 734be7eda..f264891ac 100644 --- a/src/video/windib/SDL_dibvideo.c +++ b/src/video/windib/SDL_dibvideo.c @@ -396,7 +396,15 @@ int DIB_VideoInit(_THIS, SDL_PixelFormat *vformat) /* Allow environment override of screensaver disable. */ env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER"); - this->hidden->allow_screensaver = ( (env && SDL_atoi(env)) ? 1 : 0 ); + if ( env ) { + allow_screensaver = SDL_atoi(env); + } else { +#ifdef SDL_VIDEO_DISABLE_SCREENSAVER + allow_screensaver = 0; +#else + allow_screensaver = 1; +#endif + } /* We're done! */ return(0); diff --git a/src/video/windib/SDL_dibvideo.h b/src/video/windib/SDL_dibvideo.h index 043c11d15..0278bb0f3 100644 --- a/src/video/windib/SDL_dibvideo.h +++ b/src/video/windib/SDL_dibvideo.h @@ -43,8 +43,6 @@ struct SDL_PrivateVideoData { LOGPALETTE *screen_logpal; BOOL grab_palette; - int allow_screensaver; - #define NUM_MODELISTS 4 /* 8, 16, 24, and 32 bits-per-pixel */ int SDL_nummodes[NUM_MODELISTS]; SDL_Rect **SDL_modelist[NUM_MODELISTS]; @@ -56,6 +54,9 @@ struct SDL_PrivateVideoData { int supportRotation; /* for Pocket PC devices */ DWORD origRotation; /* for Pocket PC devices */ #endif + + /* Screensaver settings */ + int allow_screensaver; }; /* Old variable names */ #define screen_bmp (this->hidden->screen_bmp) @@ -64,5 +65,6 @@ struct SDL_PrivateVideoData { #define grab_palette (this->hidden->grab_palette) #define SDL_nummodes (this->hidden->SDL_nummodes) #define SDL_modelist (this->hidden->SDL_modelist) +#define allow_screensaver (this->hidden->allow_screensaver) #endif /* _SDL_dibvideo_h */ diff --git a/src/video/x11/SDL_x11events.c b/src/video/x11/SDL_x11events.c index dd062cd4f..761a4eaaa 100644 --- a/src/video/x11/SDL_x11events.c +++ b/src/video/x11/SDL_x11events.c @@ -920,6 +920,16 @@ void X11_PumpEvents(_THIS) { int pending; + /* Update activity every five seconds to prevent screensaver. --ryan. */ + if (!allow_screensaver) { + static Uint32 screensaverTicks; + Uint32 nowTicks = SDL_GetTicks(); + if ((nowTicks - screensaverTicks) > 5000) { + XResetScreenSaver(SDL_Display); + screensaverTicks = nowTicks; + } + } + /* Keep processing pending events */ pending = 0; while ( X11_Pending(SDL_Display) ) { @@ -1389,67 +1399,3 @@ void X11_InitOSKeymap(_THIS) X11_InitKeymap(); } -void X11_SaveScreenSaver(Display *display, int *saved_timeout, BOOL *dpms) -{ - int timeout, interval, prefer_blank, allow_exp; - XGetScreenSaver(display, &timeout, &interval, &prefer_blank, &allow_exp); - *saved_timeout = timeout; - -#if SDL_VIDEO_DRIVER_X11_DPMS - if ( SDL_X11_HAVE_DPMS ) { - int dummy; - if ( DPMSQueryExtension(display, &dummy, &dummy) ) { - CARD16 state; - DPMSInfo(display, &state, dpms); - } - } -#else - *dpms = 0; -#endif /* SDL_VIDEO_DRIVER_X11_DPMS */ -} - -void X11_DisableScreenSaver(_THIS, Display *display) -{ - int timeout, interval, prefer_blank, allow_exp; - - if (this->hidden->allow_screensaver) { - return; - } - - XGetScreenSaver(display, &timeout, &interval, &prefer_blank, &allow_exp); - timeout = 0; - XSetScreenSaver(display, timeout, interval, prefer_blank, allow_exp); - -#if SDL_VIDEO_DRIVER_X11_DPMS - if ( SDL_X11_HAVE_DPMS ) { - int dummy; - if ( DPMSQueryExtension(display, &dummy, &dummy) ) { - DPMSDisable(display); - } - } -#endif /* SDL_VIDEO_DRIVER_X11_DPMS */ -} - -void X11_RestoreScreenSaver(_THIS, Display *display, int saved_timeout, BOOL dpms) -{ - int timeout, interval, prefer_blank, allow_exp; - - if (this->hidden->allow_screensaver) { - return; - } - - XGetScreenSaver(display, &timeout, &interval, &prefer_blank, &allow_exp); - timeout = saved_timeout; - XSetScreenSaver(display, timeout, interval, prefer_blank, allow_exp); - -#if SDL_VIDEO_DRIVER_X11_DPMS - if ( SDL_X11_HAVE_DPMS ) { - int dummy; - if ( DPMSQueryExtension(display, &dummy, &dummy) ) { - if ( dpms ) { - DPMSEnable(display); - } - } - } -#endif /* SDL_VIDEO_DRIVER_X11_DPMS */ -} diff --git a/src/video/x11/SDL_x11events_c.h b/src/video/x11/SDL_x11events_c.h index 18a17089f..ad02832ea 100644 --- a/src/video/x11/SDL_x11events_c.h +++ b/src/video/x11/SDL_x11events_c.h @@ -27,7 +27,3 @@ extern void X11_InitOSKeymap(_THIS); extern void X11_PumpEvents(_THIS); extern void X11_SetKeyboardState(Display *display, const char *key_vec); - -extern void X11_SaveScreenSaver(Display *display, int *saved_timeout, BOOL *dpms); -extern void X11_DisableScreenSaver(_THIS, Display *display); -extern void X11_RestoreScreenSaver(_THIS, Display *display, int saved_timeout, BOOL dpms); diff --git a/src/video/x11/SDL_x11sym.h b/src/video/x11/SDL_x11sym.h index 9839fc9b3..2dff59007 100644 --- a/src/video/x11/SDL_x11sym.h +++ b/src/video/x11/SDL_x11sym.h @@ -56,7 +56,6 @@ SDL_X11_SYM(int,XFreePixmap,(Display* a,Pixmap b),(a,b),return) SDL_X11_SYM(int,XGetErrorDatabaseText,(Display* a,_Xconst char* b,_Xconst char* c,_Xconst char* d,char* e,int f),(a,b,c,d,e,f),return) SDL_X11_SYM(XModifierKeymap*,XGetModifierMapping,(Display* a),(a),return) SDL_X11_SYM(int,XGetPointerControl,(Display* a,int* b,int* c,int* d),(a,b,c,d),return) -SDL_X11_SYM(int,XGetScreenSaver,(Display* a,int* b,int* c,int* d, int* e),(a,b,c,d,e),return) SDL_X11_SYM(XVisualInfo*,XGetVisualInfo,(Display* a,long b,XVisualInfo* c,int* d),(a,b,c,d),return) SDL_X11_SYM(XWMHints*,XGetWMHints,(Display* a,Window b),(a,b),return) SDL_X11_SYM(Status,XGetWindowAttributes,(Display* a,Window b,XWindowAttributes* c),(a,b,c),return) @@ -85,13 +84,13 @@ SDL_X11_SYM(int,XQueryKeymap,(Display* a,char *b),(a,b),return) SDL_X11_SYM(Bool,XQueryPointer,(Display* a,Window b,Window* c,Window* d,int* e,int* f,int* g,int* h,unsigned int* i),(a,b,c,d,e,f,g,h,i),return) SDL_X11_SYM(int,XRaiseWindow,(Display* a,Window b),(a,b),return) SDL_X11_SYM(int,XReparentWindow,(Display* a,Window b,Window c,int d,int e),(a,b,c,d,e),return) +SDL_X11_SYM(int,XResetScreenSaver,(Display* a),(a),return) SDL_X11_SYM(int,XResizeWindow,(Display* a,Window b,unsigned int c,unsigned int d),(a,b,c,d),return) SDL_X11_SYM(int,XSelectInput,(Display* a,Window b,long c),(a,b,c),return) SDL_X11_SYM(Status,XSendEvent,(Display* a,Window b,Bool c,long d,XEvent* e),(a,b,c,d,e),return) SDL_X11_SYM(int,XSetClassHint,(Display* a,Window b,XClassHint* c),(a,b,c),return) SDL_X11_SYM(XErrorHandler,XSetErrorHandler,(XErrorHandler a),(a),return) SDL_X11_SYM(XIOErrorHandler,XSetIOErrorHandler,(XIOErrorHandler a),(a),return) -SDL_X11_SYM(int,XSetScreenSaver,(Display* a,int b,int c,int d,int e),(a,b,c,d,e),return) SDL_X11_SYM(int,XSetTransientForHint,(Display* a,Window b,Window c),(a,b,c),return) SDL_X11_SYM(int,XSetWMHints,(Display* a,Window b,XWMHints* c),(a,b,c),return) SDL_X11_SYM(void,XSetTextProperty,(Display* a,Window b,XTextProperty* c,Atom d),(a,b,c,d),) @@ -192,14 +191,5 @@ SDL_X11_SYM(Status,XRRSetScreenConfig,(Display *dpy, XRRScreenConfiguration *con SDL_X11_SYM(void,XRRFreeScreenConfigInfo,(XRRScreenConfiguration *config),(config),) #endif -/* DPMS support */ -#if SDL_VIDEO_DRIVER_X11_DPMS -SDL_X11_MODULE(DPMS) -SDL_X11_SYM(Status,DPMSQueryExtension,(Display *dpy,int *major_versionp,int *minor_versionp),(dpy,major_versionp,minor_versionp),return) -SDL_X11_SYM(Status,DPMSInfo,(Display *dpy,CARD16 *state,BOOL *onoff),(dpy,state,onoff),return) -SDL_X11_SYM(Status,DPMSEnable,(Display *dpy),(dpy),return) -SDL_X11_SYM(Status,DPMSDisable,(Display *dpy),(dpy),return) -#endif - /* end of SDL_x11sym.h ... */ diff --git a/src/video/x11/SDL_x11video.c b/src/video/x11/SDL_x11video.c index 06858720e..33ab1aa80 100644 --- a/src/video/x11/SDL_x11video.c +++ b/src/video/x11/SDL_x11video.c @@ -556,7 +556,7 @@ static void create_aux_windows(_THIS) static int X11_VideoInit(_THIS, SDL_PixelFormat *vformat) { - const char *env = NULL; + const char *env; char *display; int i; @@ -669,11 +669,15 @@ static int X11_VideoInit(_THIS, SDL_PixelFormat *vformat) /* Allow environment override of screensaver disable. */ env = SDL_getenv("SDL_VIDEO_ALLOW_SCREENSAVER"); - this->hidden->allow_screensaver = ( (env && SDL_atoi(env)) ? 1 : 0 ); - - /* Save DPMS and screensaver settings */ - X11_SaveScreenSaver(SDL_Display, &screensaver_timeout, &dpms_enabled); - X11_DisableScreenSaver(this, SDL_Display); + if ( env ) { + allow_screensaver = SDL_atoi(env); + } else { +#ifdef SDL_VIDEO_DISABLE_SCREENSAVER + allow_screensaver = 0; +#else + allow_screensaver = 1; +#endif + } /* See if we have been passed a window to use */ SDL_windowid = SDL_getenv("SDL_WINDOWID"); @@ -1506,9 +1510,6 @@ void X11_VideoQuit(_THIS) X11_SwapVidModeGamma(this); } - /* Restore DPMS and screensaver settings */ - X11_RestoreScreenSaver(this, SDL_Display, screensaver_timeout, dpms_enabled); - /* Free that blank cursor */ if ( SDL_BlankCursor != NULL ) { this->FreeWMCursor(this, SDL_BlankCursor); diff --git a/src/video/x11/SDL_x11video.h b/src/video/x11/SDL_x11video.h index 920942efd..ddfd5b68d 100644 --- a/src/video/x11/SDL_x11video.h +++ b/src/video/x11/SDL_x11video.h @@ -46,9 +46,6 @@ #if SDL_VIDEO_DRIVER_X11_XME #include "../Xext/extensions/xme.h" #endif -#if SDL_VIDEO_DRIVER_X11_DPMS -#include -#endif #include "SDL_x11dyn.h" @@ -139,8 +136,6 @@ struct SDL_PrivateVideoData { int use_xme; int currently_fullscreen; - int allow_screensaver; - /* Automatic mode switching support (entering/leaving fullscreen) */ Uint32 switch_waiting; Uint32 switch_time; @@ -158,8 +153,7 @@ struct SDL_PrivateVideoData { short *iconcolors; /* List of colors used by the icon */ /* Screensaver settings */ - int screensaver_timeout; - BOOL dpms_enabled; + int allow_screensaver; }; /* Old variable names */ @@ -210,8 +204,8 @@ struct SDL_PrivateVideoData { #define gamma_saved (this->hidden->gamma_saved) #define gamma_changed (this->hidden->gamma_changed) #define SDL_iconcolors (this->hidden->iconcolors) -#define screensaver_timeout (this->hidden->screensaver_timeout) -#define dpms_enabled (this->hidden->dpms_enabled) +#define allow_screensaver (this->hidden->allow_screensaver) + /* Some versions of XFree86 have bugs - detect if this is one of them */ #define BUGGY_XFREE86(condition, buggy_version) \ ((SDL_strcmp(ServerVendor(SDL_Display), "The XFree86 Project, Inc") == 0) && \ diff --git a/src/video/xbios/SDL_xbios_centscreen.c b/src/video/xbios/SDL_xbios_centscreen.c index 96e5d7ed8..9cd77e7d1 100644 --- a/src/video/xbios/SDL_xbios_centscreen.c +++ b/src/video/xbios/SDL_xbios_centscreen.c @@ -85,10 +85,12 @@ void SDL_XBIOS_CentscreenSetmode(_THIS, int width, int height, int planes) newmode.plan = planes; Vwrite(0, &newmode, &curmode); +#ifdef SDL_VIDEO_DISABLE_SCREENSAVER /* Disable screensaver */ Vread(&newmode); newmode.mode &= ~(CSCREEN_SAVER|CSCREEN_ENERGYSTAR); Vwrite(0, &newmode, &curmode); +#endif /* SDL_VIDEO_DISABLE_SCREENSAVER */ } void SDL_XBIOS_CentscreenRestore(_THIS, int prev_handle)