|
|
|
@ -312,8 +312,9 @@ void SaverEngine::enableExports()
|
|
|
|
|
|
|
|
|
|
TQCString appname( "kdesktop" );
|
|
|
|
|
int screen_number = DefaultScreen(tqt_xdisplay());
|
|
|
|
|
if ( screen_number )
|
|
|
|
|
if ( screen_number ) {
|
|
|
|
|
appname.sprintf("kdesktop-screen-%d", screen_number );
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
client->send( appname, "KBackgroundIface", "setExport(int)", data );
|
|
|
|
|
#endif
|
|
|
|
@ -361,8 +362,9 @@ void SaverEngine::slotSAKProcessExited()
|
|
|
|
|
void SaverEngine::configure()
|
|
|
|
|
{
|
|
|
|
|
// If we aren't in a suitable state, we will not reconfigure.
|
|
|
|
|
if (mState != Waiting)
|
|
|
|
|
if (mState != Waiting) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
// create a new config obj to ensure we read the latest options
|
|
|
|
|
KDesktopSettings::self()->readConfig();
|
|
|
|
@ -402,15 +404,13 @@ bool SaverEngine::restartDesktopLockProcess()
|
|
|
|
|
mSaverProcessReady = false;
|
|
|
|
|
mLockProcess.clearArguments();
|
|
|
|
|
TQString path = TDEStandardDirs::findExe( "kdesktop_lock" );
|
|
|
|
|
if( path.isEmpty())
|
|
|
|
|
{
|
|
|
|
|
if (path.isEmpty()) {
|
|
|
|
|
kdDebug( 1204 ) << "Can't find kdesktop_lock!" << endl;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
|
mLockProcess << path;
|
|
|
|
|
mLockProcess << TQString( "--internal" ) << TQString( "%1" ).arg(getpid());
|
|
|
|
|
if (mLockProcess.start() == false )
|
|
|
|
|
{
|
|
|
|
|
if (mLockProcess.start() == false) {
|
|
|
|
|
kdDebug( 1204 ) << "Failed to start kdesktop_lock!" << endl;
|
|
|
|
|
return false;
|
|
|
|
|
}
|
|
|
|
@ -478,8 +478,7 @@ bool SaverEngine::startLockProcess( LockType lock_type )
|
|
|
|
|
XSetScreenSaver(tqt_xdisplay(), 0, mXInterval, PreferBlanking, mXExposures);
|
|
|
|
|
|
|
|
|
|
mState = Engaging;
|
|
|
|
|
if (mXAutoLock)
|
|
|
|
|
{
|
|
|
|
|
if (mXAutoLock) {
|
|
|
|
|
mXAutoLock->stop();
|
|
|
|
|
}
|
|
|
|
|
return true;
|
|
|
|
@ -491,21 +490,18 @@ bool SaverEngine::startLockProcess( LockType lock_type )
|
|
|
|
|
//
|
|
|
|
|
void SaverEngine::stopLockProcess()
|
|
|
|
|
{
|
|
|
|
|
if (mState == Waiting)
|
|
|
|
|
{
|
|
|
|
|
if (mState == Waiting) {
|
|
|
|
|
kdWarning(1204) << "SaverEngine::stopSaver() saver not active" << endl;
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
kdDebug(1204) << "SaverEngine: stopping lock" << endl;
|
|
|
|
|
emitDCOPSignal("KDE_stop_screensaver()", TQByteArray());
|
|
|
|
|
|
|
|
|
|
mTerminationRequested=true;
|
|
|
|
|
mTerminationRequested = true;
|
|
|
|
|
mLockProcess.kill();
|
|
|
|
|
|
|
|
|
|
if (mEnabled)
|
|
|
|
|
{
|
|
|
|
|
if (mXAutoLock)
|
|
|
|
|
{
|
|
|
|
|
if (mEnabled) {
|
|
|
|
|
if (mXAutoLock) {
|
|
|
|
|
mXAutoLock->start();
|
|
|
|
|
}
|
|
|
|
|
XForceScreenSaver(tqt_xdisplay(), ScreenSaverReset );
|
|
|
|
@ -524,13 +520,13 @@ void SaverEngine::stopLockProcess()
|
|
|
|
|
void SaverEngine::recoverFromHackingAttempt()
|
|
|
|
|
{
|
|
|
|
|
// Try to relaunch saver with forcelock
|
|
|
|
|
if (!startLockProcess( ForceLock )) {
|
|
|
|
|
if (!startLockProcess(ForceLock)) {
|
|
|
|
|
// Terminate the TDE session ASAP!
|
|
|
|
|
// Values are explained at http://lists.kde.org/?l=kde-linux&m=115770988603387
|
|
|
|
|
TQByteArray data;
|
|
|
|
|
TQDataStream arg(data, IO_WriteOnly);
|
|
|
|
|
arg << (int)0 << (int)0 << (int)2;
|
|
|
|
|
if ( ! kapp->dcopClient()->send("ksmserver", "default", "logout(int,int,int)", data) ) {
|
|
|
|
|
if (!kapp->dcopClient()->send("ksmserver", "default", "logout(int,int,int)", data)) {
|
|
|
|
|
// Someone got to DCOP before we did
|
|
|
|
|
// Try an emergency system logout
|
|
|
|
|
system("logout");
|
|
|
|
@ -594,13 +590,12 @@ void SaverEngine::lockProcessWaiting()
|
|
|
|
|
if (trinity_lockeng_sak_available == TRUE) {
|
|
|
|
|
handleSecureDialog();
|
|
|
|
|
}
|
|
|
|
|
if( mState == Waiting )
|
|
|
|
|
if( mState == Waiting ) {
|
|
|
|
|
return;
|
|
|
|
|
}
|
|
|
|
|
emitDCOPSignal("KDE_stop_screensaver()", TQByteArray());
|
|
|
|
|
if (mEnabled)
|
|
|
|
|
{
|
|
|
|
|
if (mXAutoLock)
|
|
|
|
|
{
|
|
|
|
|
if (mEnabled) {
|
|
|
|
|
if (mXAutoLock) {
|
|
|
|
|
mXAutoLock->start();
|
|
|
|
|
}
|
|
|
|
|
XForceScreenSaver(tqt_xdisplay(), ScreenSaverReset );
|
|
|
|
@ -630,25 +625,19 @@ void SaverEngine::idleTimeout()
|
|
|
|
|
|
|
|
|
|
xautolock_corner_t SaverEngine::applyManualSettings(int action)
|
|
|
|
|
{
|
|
|
|
|
if (action == 0)
|
|
|
|
|
{
|
|
|
|
|
if (action == 0) {
|
|
|
|
|
kdDebug() << "no lock" << endl;
|
|
|
|
|
return ca_nothing;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (action == 1)
|
|
|
|
|
{
|
|
|
|
|
else if (action == 1) {
|
|
|
|
|
kdDebug() << "lock screen" << endl;
|
|
|
|
|
return ca_forceLock;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
if (action == 2)
|
|
|
|
|
{
|
|
|
|
|
else if (action == 2) {
|
|
|
|
|
kdDebug() << "prevent lock" << endl;
|
|
|
|
|
return ca_dontLock;
|
|
|
|
|
}
|
|
|
|
|
else
|
|
|
|
|
{
|
|
|
|
|
else{
|
|
|
|
|
kdDebug() << "no lock nothing" << endl;
|
|
|
|
|
return ca_nothing;
|
|
|
|
|
}
|
|
|
|
|