Index: kdesktop/lockeng.cc =================================================================== --- kdesktop/lockeng.cc (revision 548007) +++ kdesktop/lockeng.cc (revision 548008) @@ -42,9 +42,6 @@ XGetScreenSaver(qt_xdisplay(), &mXTimeout, &mXInterval, &mXBlanking, &mXExposures); - // We'll handle blanking - XSetScreenSaver(qt_xdisplay(), 0, mXInterval, mXBlanking, mXExposures); - mState = Waiting; mXAutoLock = 0; mEnabled = false; @@ -158,6 +155,9 @@ mXAutoLock->setDPMS(mDPMS); //mXAutoLock->changeCornerLockStatus( mLockCornerTopLeft, mLockCornerTopRight, mLockCornerBottomLeft, mLockCornerBottomRight); + // We'll handle blanking + XSetScreenSaver(qt_xdisplay(), mTimeout + 10, mXInterval, mXBlanking, mXExposures); + mXAutoLock->start(); kdDebug(1204) << "Saver Engine started, timeout: " << mTimeout << endl; @@ -170,6 +170,7 @@ mXAutoLock = 0; } + XSetScreenSaver(qt_xdisplay(), 0, mXInterval, mXBlanking, mXExposures); kdDebug(1204) << "Saver Engine disabled" << endl; } @@ -291,7 +292,6 @@ kdDebug(1204) << "SaverEngine: stopping lock" << endl; emitDCOPSignal("KDE_stop_screensaver()", QByteArray()); - mLockProcess.kill(); if (mXAutoLock) @@ -300,6 +300,7 @@ } processLockTransactions(); mState = Waiting; + XSetScreenSaver(qt_xdisplay(), mTimeout + 10, mXInterval, mXBlanking, mXExposures); } void SaverEngine::lockProcessExited() @@ -314,6 +315,7 @@ } processLockTransactions(); mState = Waiting; + XSetScreenSaver(qt_xdisplay(), mTimeout + 10, mXInterval, mXBlanking, mXExposures); } //--------------------------------------------------------------------------- @@ -322,6 +324,8 @@ // void SaverEngine::idleTimeout() { + // disable X screensaver + XSetScreenSaver(qt_xdisplay(), 0, mXInterval, mXBlanking, mXExposures); startLockProcess( DefaultLock ); } Index: kdesktop/xautolock.cc =================================================================== --- kdesktop/xautolock.cc (revision 548007) +++ kdesktop/xautolock.cc (revision 548008) @@ -192,6 +192,7 @@ bool activate = false; + kdDebug() << now << " " << mTrigger << endl; if (now >= mTrigger) { resetTrigger(); @@ -202,6 +203,8 @@ BOOL on; CARD16 state; DPMSInfo( qt_xdisplay(), &state, &on ); + + kdDebug() << "DPMSInfo " << state << " " << on << endl; // If DPMS is active, it makes XScreenSaverQueryInfo() report idle time // that is always smaller than DPMS timeout (X bug I guess). So if DPMS // saving is active, simply always activate our saving too, otherwise @@ -217,9 +220,11 @@ #ifdef HAVE_XSCREENSAVER static XScreenSaverInfo* mitInfo = 0; if (!mitInfo) mitInfo = XScreenSaverAllocInfo (); - XScreenSaverQueryInfo (qt_xdisplay(), DefaultRootWindow (qt_xdisplay()), mitInfo); - if (mitInfo->state == ScreenSaverDisabled) - activate = false; + if (XScreenSaverQueryInfo (qt_xdisplay(), DefaultRootWindow (qt_xdisplay()), mitInfo)) { + kdDebug() << "XScreenSaverQueryInfo " << mitInfo->state << " " << ScreenSaverDisabled << endl; + if (mitInfo->state == ScreenSaverDisabled) + activate = false; + } #endif if(mActive && activate)