summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2015-09-19 18:57:39 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2015-09-19 18:57:39 -0500
commitdd2951393f39967bcda55c03eb1b8d67c0c3d504 (patch)
tree5175a291d7304b61fb29dec18ffc95fe1c8698e8
parentfcb6161ceeb138b648a6031d714febfc73a925ba (diff)
downloadtdebase-dd2951393f39967bcda55c03eb1b8d67c0c3d504.tar.gz
tdebase-dd2951393f39967bcda55c03eb1b8d67c0c3d504.zip
Prevent saver from starting while valid card is inserted
-rw-r--r--kdesktop/lockeng.cc26
1 files changed, 16 insertions, 10 deletions
diff --git a/kdesktop/lockeng.cc b/kdesktop/lockeng.cc
index 5173916c9..0c7558f9b 100644
--- a/kdesktop/lockeng.cc
+++ b/kdesktop/lockeng.cc
@@ -247,21 +247,20 @@ void SaverEngine::cryptographicCardInserted(TDECryptographicCardDevice* cdevice)
KUser user;
if (login_name == user.loginName()) {
mValidCryptoCardInserted = true;
- // Disable saver startup
- enable(false);
}
}
}
void SaverEngine::cryptographicCardRemoved(TDECryptographicCardDevice* cdevice) {
if (mValidCryptoCardInserted) {
+ mValidCryptoCardInserted = false;
+
// Restore saver timeout
configure();
// Force lock
lockScreen();
}
- mValidCryptoCardInserted = false;
}
//---------------------------------------------------------------------------
@@ -279,6 +278,10 @@ void SaverEngine::lock()
//
void SaverEngine::lockScreen(bool DCOP)
{
+ if (mValidCryptoCardInserted) {
+ return;
+ }
+
bool ok = true;
if (mState != Saving)
{
@@ -328,9 +331,10 @@ void SaverEngine::saverLockReady()
//---------------------------------------------------------------------------
void SaverEngine::save()
{
- if (mState == Waiting)
- {
- startLockProcess( DefaultLock );
+ if (!mValidCryptoCardInserted) {
+ if (mState == Waiting) {
+ startLockProcess( DefaultLock );
+ }
}
}
@@ -727,10 +731,12 @@ void SaverEngine::lockProcessWaiting()
//
void SaverEngine::idleTimeout()
{
- // disable X screensaver
- XForceScreenSaver(tqt_xdisplay(), ScreenSaverReset );
- XSetScreenSaver(tqt_xdisplay(), 0, mXInterval, PreferBlanking, DontAllowExposures);
- startLockProcess( DefaultLock );
+ if (!mValidCryptoCardInserted) {
+ // disable X screensaver
+ XForceScreenSaver(tqt_xdisplay(), ScreenSaverReset );
+ XSetScreenSaver(tqt_xdisplay(), 0, mXInterval, PreferBlanking, DontAllowExposures);
+ startLockProcess( DefaultLock );
+ }
}
xautolock_corner_t SaverEngine::applyManualSettings(int action)