Disable the X11 screensaver in LowLevelWindow_X11.
This commit is contained in:
@@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
#include "RageSurface.h"
|
#include "RageSurface.h"
|
||||||
#include "RageSurfaceUtils.h"
|
#include "RageSurfaceUtils.h"
|
||||||
#include "PrefsManager.h" // XXX
|
|
||||||
#include "ScreenDimensions.h" // XXX
|
#include "ScreenDimensions.h" // XXX
|
||||||
|
|
||||||
/* Windows's broken gl.h defines GL_EXT_paletted_texture incompletely: */
|
/* Windows's broken gl.h defines GL_EXT_paletted_texture incompletely: */
|
||||||
@@ -46,6 +45,7 @@
|
|||||||
#include "RageMath.h"
|
#include "RageMath.h"
|
||||||
#include "RageTypes.h"
|
#include "RageTypes.h"
|
||||||
#include "RageUtil.h"
|
#include "RageUtil.h"
|
||||||
|
#include "EnumHelper.h"
|
||||||
#include "ProductInfo.h"
|
#include "ProductInfo.h"
|
||||||
|
|
||||||
#include "arch/LowLevelWindow/LowLevelWindow.h"
|
#include "arch/LowLevelWindow/LowLevelWindow.h"
|
||||||
@@ -444,10 +444,6 @@ CString RageDisplay_OGL::Init( VideoModeParams p, bool bAllowUnacceleratedRender
|
|||||||
return CString();
|
return CString();
|
||||||
}
|
}
|
||||||
|
|
||||||
#if defined(UNIX) && defined(HAVE_LIBXTST)
|
|
||||||
#include <X11/extensions/XTest.h>
|
|
||||||
#endif
|
|
||||||
|
|
||||||
RageDisplay_OGL::~RageDisplay_OGL()
|
RageDisplay_OGL::~RageDisplay_OGL()
|
||||||
{
|
{
|
||||||
delete g_pWind;
|
delete g_pWind;
|
||||||
@@ -693,40 +689,6 @@ void RageDisplay_OGL::EndFrame()
|
|||||||
|
|
||||||
g_pWind->Update();
|
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();
|
RageDisplay::EndFrame();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -3,6 +3,7 @@
|
|||||||
#include "RageLog.h"
|
#include "RageLog.h"
|
||||||
#include "RageException.h"
|
#include "RageException.h"
|
||||||
#include "archutils/Unix/X11Helper.h"
|
#include "archutils/Unix/X11Helper.h"
|
||||||
|
#include "PrefsManager.h" // XXX
|
||||||
|
|
||||||
#include <stack>
|
#include <stack>
|
||||||
#include <math.h> // ceil()
|
#include <math.h> // ceil()
|
||||||
@@ -10,6 +11,10 @@
|
|||||||
#include <GL/glx.h> // All sorts of stuff...
|
#include <GL/glx.h> // All sorts of stuff...
|
||||||
#include <X11/Xatom.h>
|
#include <X11/Xatom.h>
|
||||||
|
|
||||||
|
#if defined(HAVE_LIBXTST)
|
||||||
|
#include <X11/extensions/XTest.h>
|
||||||
|
#endif
|
||||||
|
|
||||||
extern Display *g_X11Display;
|
extern Display *g_X11Display;
|
||||||
|
|
||||||
LowLevelWindow_X11::LowLevelWindow_X11()
|
LowLevelWindow_X11::LowLevelWindow_X11()
|
||||||
@@ -190,6 +195,38 @@ bool LowLevelWindow_X11::IsSoftwareRenderer( CString &sError )
|
|||||||
void LowLevelWindow_X11::SwapBuffers()
|
void LowLevelWindow_X11::SwapBuffers()
|
||||||
{
|
{
|
||||||
glXSwapBuffers( X11Helper::Dpy, X11Helper::Win );
|
glXSwapBuffers( X11Helper::Dpy, X11Helper::Win );
|
||||||
|
|
||||||
|
if( PREFSMAN->m_bDisableScreenSaver )
|
||||||
|
{
|
||||||
|
/* Disable the screensaver. */
|
||||||
|
#if defined(HAVE_LIBXTST)
|
||||||
|
/* This causes flicker. */
|
||||||
|
// XForceScreenSaver( X11Helper::Dpy, 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( X11Helper::Dpy );
|
||||||
|
|
||||||
|
int event_base, error_base, major, minor;
|
||||||
|
if( XTestQueryExtension( X11Helper::Dpy, &event_base, &error_base, &major, &minor ) )
|
||||||
|
{
|
||||||
|
XTestFakeRelativeMotionEvent( X11Helper::Dpy, 0, 0, 0 );
|
||||||
|
XSync( X11Helper::Dpy, False );
|
||||||
|
}
|
||||||
|
|
||||||
|
XUnlockDisplay( X11Helper::Dpy );
|
||||||
|
#endif
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
|||||||
Reference in New Issue
Block a user