Disable the X11 screensaver in LowLevelWindow_X11.

This commit is contained in:
Glenn Maynard
2005-11-13 19:04:07 +00:00
parent e42c227d33
commit 7803d84ddd
2 changed files with 38 additions and 39 deletions
+1 -39
View File
@@ -20,7 +20,6 @@
#include "RageSurface.h"
#include "RageSurfaceUtils.h"
#include "PrefsManager.h" // XXX
#include "ScreenDimensions.h" // XXX
/* Windows's broken gl.h defines GL_EXT_paletted_texture incompletely: */
@@ -46,6 +45,7 @@
#include "RageMath.h"
#include "RageTypes.h"
#include "RageUtil.h"
#include "EnumHelper.h"
#include "ProductInfo.h"
#include "arch/LowLevelWindow/LowLevelWindow.h"
@@ -444,10 +444,6 @@ CString RageDisplay_OGL::Init( VideoModeParams p, bool bAllowUnacceleratedRender
return CString();
}
#if defined(UNIX) && defined(HAVE_LIBXTST)
#include <X11/extensions/XTest.h>
#endif
RageDisplay_OGL::~RageDisplay_OGL()
{
delete g_pWind;
@@ -693,40 +689,6 @@ void RageDisplay_OGL::EndFrame()
g_pWind->Update();
if( PREFSMAN->m_bDisableScreenSaver )
{
/* Disable the screensaver. */
#if defined(UNIX) && defined(HAVE_LIBXTST)
ASSERT( g_X11Display );
/* This causes flicker. */
// XForceScreenSaver( g_X11Display, ScreenSaverReset );
/*
* Instead, send a null relative mouse motion, to trick X into thinking there has been
* user activity.
*
* This also handles XScreenSaver; XForceScreenSaver only handles the internal X11
* screen blanker.
*
* This will delay the X blanker, DPMS and XScreenSaver from activating, and will
* disable the blanker and XScreenSaver if they're already active (unless XSS is
* locked). For some reason, it doesn't un-blank DPMS if it's already active.
*/
XLockDisplay( g_X11Display );
int event_base, error_base, major, minor;
if( XTestQueryExtension( g_X11Display, &event_base, &error_base, &major, &minor ) )
{
XTestFakeRelativeMotionEvent( g_X11Display, 0, 0, 0 );
XSync( g_X11Display, False );
}
XUnlockDisplay( g_X11Display );
#endif
}
RageDisplay::EndFrame();
}