|
|
@ -19,6 +19,7 @@ IdleTimeDetector::IdleTimeDetector(int maxIdle)
|
|
|
|
if(XScreenSaverQueryExtension(qt_xdisplay(), &event_base, &error_base))
|
|
|
|
if(XScreenSaverQueryExtension(qt_xdisplay(), &event_base, &error_base))
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_idleDetectionPossible = true;
|
|
|
|
_idleDetectionPossible = true;
|
|
|
|
|
|
|
|
_mit_info = XScreenSaverAllocInfo ();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else
|
|
|
|
{
|
|
|
|
{
|
|
|
@ -44,7 +45,6 @@ void IdleTimeDetector::check()
|
|
|
|
#ifdef HAVE_LIBXSS
|
|
|
|
#ifdef HAVE_LIBXSS
|
|
|
|
if (_idleDetectionPossible)
|
|
|
|
if (_idleDetectionPossible)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
_mit_info = XScreenSaverAllocInfo ();
|
|
|
|
|
|
|
|
XScreenSaverQueryInfo(qt_xdisplay(), qt_xrootwin(), _mit_info);
|
|
|
|
XScreenSaverQueryInfo(qt_xdisplay(), qt_xrootwin(), _mit_info);
|
|
|
|
int idleSeconds = (_mit_info->idle/1000);
|
|
|
|
int idleSeconds = (_mit_info->idle/1000);
|
|
|
|
if (idleSeconds >= _maxIdle)
|
|
|
|
if (idleSeconds >= _maxIdle)
|
|
|
|