|
|
@ -312,8 +312,9 @@ void SaverEngine::enableExports()
|
|
|
|
|
|
|
|
|
|
|
|
TQCString appname( "kdesktop" );
|
|
|
|
TQCString appname( "kdesktop" );
|
|
|
|
int screen_number = DefaultScreen(tqt_xdisplay());
|
|
|
|
int screen_number = DefaultScreen(tqt_xdisplay());
|
|
|
|
if ( screen_number )
|
|
|
|
if ( screen_number ) {
|
|
|
|
appname.sprintf("kdesktop-screen-%d", screen_number );
|
|
|
|
appname.sprintf("kdesktop-screen-%d", screen_number );
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
client->send( appname, "KBackgroundIface", "setExport(int)", data );
|
|
|
|
client->send( appname, "KBackgroundIface", "setExport(int)", data );
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
@ -361,8 +362,9 @@ void SaverEngine::slotSAKProcessExited()
|
|
|
|
void SaverEngine::configure()
|
|
|
|
void SaverEngine::configure()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
// If we aren't in a suitable state, we will not reconfigure.
|
|
|
|
// If we aren't in a suitable state, we will not reconfigure.
|
|
|
|
if (mState != Waiting)
|
|
|
|
if (mState != Waiting) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// create a new config obj to ensure we read the latest options
|
|
|
|
// create a new config obj to ensure we read the latest options
|
|
|
|
KDesktopSettings::self()->readConfig();
|
|
|
|
KDesktopSettings::self()->readConfig();
|
|
|
@ -402,15 +404,13 @@ bool SaverEngine::restartDesktopLockProcess()
|
|
|
|
mSaverProcessReady = false;
|
|
|
|
mSaverProcessReady = false;
|
|
|
|
mLockProcess.clearArguments();
|
|
|
|
mLockProcess.clearArguments();
|
|
|
|
TQString path = TDEStandardDirs::findExe( "kdesktop_lock" );
|
|
|
|
TQString path = TDEStandardDirs::findExe( "kdesktop_lock" );
|
|
|
|
if( path.isEmpty())
|
|
|
|
if (path.isEmpty()) {
|
|
|
|
{
|
|
|
|
|
|
|
|
kdDebug( 1204 ) << "Can't find kdesktop_lock!" << endl;
|
|
|
|
kdDebug( 1204 ) << "Can't find kdesktop_lock!" << endl;
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
mLockProcess << path;
|
|
|
|
mLockProcess << path;
|
|
|
|
mLockProcess << TQString( "--internal" ) << TQString( "%1" ).arg(getpid());
|
|
|
|
mLockProcess << TQString( "--internal" ) << TQString( "%1" ).arg(getpid());
|
|
|
|
if (mLockProcess.start() == false )
|
|
|
|
if (mLockProcess.start() == false) {
|
|
|
|
{
|
|
|
|
|
|
|
|
kdDebug( 1204 ) << "Failed to start kdesktop_lock!" << endl;
|
|
|
|
kdDebug( 1204 ) << "Failed to start kdesktop_lock!" << endl;
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -478,8 +478,7 @@ bool SaverEngine::startLockProcess( LockType lock_type )
|
|
|
|
XSetScreenSaver(tqt_xdisplay(), 0, mXInterval, PreferBlanking, mXExposures);
|
|
|
|
XSetScreenSaver(tqt_xdisplay(), 0, mXInterval, PreferBlanking, mXExposures);
|
|
|
|
|
|
|
|
|
|
|
|
mState = Engaging;
|
|
|
|
mState = Engaging;
|
|
|
|
if (mXAutoLock)
|
|
|
|
if (mXAutoLock) {
|
|
|
|
{
|
|
|
|
|
|
|
|
mXAutoLock->stop();
|
|
|
|
mXAutoLock->stop();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
return true;
|
|
|
@ -491,8 +490,7 @@ bool SaverEngine::startLockProcess( LockType lock_type )
|
|
|
|
//
|
|
|
|
//
|
|
|
|
void SaverEngine::stopLockProcess()
|
|
|
|
void SaverEngine::stopLockProcess()
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (mState == Waiting)
|
|
|
|
if (mState == Waiting) {
|
|
|
|
{
|
|
|
|
|
|
|
|
kdWarning(1204) << "SaverEngine::stopSaver() saver not active" << endl;
|
|
|
|
kdWarning(1204) << "SaverEngine::stopSaver() saver not active" << endl;
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -502,10 +500,8 @@ void SaverEngine::stopLockProcess()
|
|
|
|
mTerminationRequested = true;
|
|
|
|
mTerminationRequested = true;
|
|
|
|
mLockProcess.kill();
|
|
|
|
mLockProcess.kill();
|
|
|
|
|
|
|
|
|
|
|
|
if (mEnabled)
|
|
|
|
if (mEnabled) {
|
|
|
|
{
|
|
|
|
if (mXAutoLock) {
|
|
|
|
if (mXAutoLock)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mXAutoLock->start();
|
|
|
|
mXAutoLock->start();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
XForceScreenSaver(tqt_xdisplay(), ScreenSaverReset );
|
|
|
|
XForceScreenSaver(tqt_xdisplay(), ScreenSaverReset );
|
|
|
@ -594,13 +590,12 @@ void SaverEngine::lockProcessWaiting()
|
|
|
|
if (trinity_lockeng_sak_available == TRUE) {
|
|
|
|
if (trinity_lockeng_sak_available == TRUE) {
|
|
|
|
handleSecureDialog();
|
|
|
|
handleSecureDialog();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
if( mState == Waiting )
|
|
|
|
if( mState == Waiting ) {
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
|
|
|
|
}
|
|
|
|
emitDCOPSignal("KDE_stop_screensaver()", TQByteArray());
|
|
|
|
emitDCOPSignal("KDE_stop_screensaver()", TQByteArray());
|
|
|
|
if (mEnabled)
|
|
|
|
if (mEnabled) {
|
|
|
|
{
|
|
|
|
if (mXAutoLock) {
|
|
|
|
if (mXAutoLock)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
mXAutoLock->start();
|
|
|
|
mXAutoLock->start();
|
|
|
|
}
|
|
|
|
}
|
|
|
|
XForceScreenSaver(tqt_xdisplay(), ScreenSaverReset );
|
|
|
|
XForceScreenSaver(tqt_xdisplay(), ScreenSaverReset );
|
|
|
@ -630,25 +625,19 @@ void SaverEngine::idleTimeout()
|
|
|
|
|
|
|
|
|
|
|
|
xautolock_corner_t SaverEngine::applyManualSettings(int action)
|
|
|
|
xautolock_corner_t SaverEngine::applyManualSettings(int action)
|
|
|
|
{
|
|
|
|
{
|
|
|
|
if (action == 0)
|
|
|
|
if (action == 0) {
|
|
|
|
{
|
|
|
|
|
|
|
|
kdDebug() << "no lock" << endl;
|
|
|
|
kdDebug() << "no lock" << endl;
|
|
|
|
return ca_nothing;
|
|
|
|
return ca_nothing;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else if (action == 1) {
|
|
|
|
if (action == 1)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
kdDebug() << "lock screen" << endl;
|
|
|
|
kdDebug() << "lock screen" << endl;
|
|
|
|
return ca_forceLock;
|
|
|
|
return ca_forceLock;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else if (action == 2) {
|
|
|
|
if (action == 2)
|
|
|
|
|
|
|
|
{
|
|
|
|
|
|
|
|
kdDebug() << "prevent lock" << endl;
|
|
|
|
kdDebug() << "prevent lock" << endl;
|
|
|
|
return ca_dontLock;
|
|
|
|
return ca_dontLock;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
else
|
|
|
|
else{
|
|
|
|
{
|
|
|
|
|
|
|
|
kdDebug() << "no lock nothing" << endl;
|
|
|
|
kdDebug() << "no lock nothing" << endl;
|
|
|
|
return ca_nothing;
|
|
|
|
return ca_nothing;
|
|
|
|
}
|
|
|
|
}
|
|
|
|