diff options
-rw-r--r-- | kdesktop/krootwm.cc | 18 | ||||
-rw-r--r-- | kdesktop/lock/lockprocess.cc | 4 | ||||
-rw-r--r-- | kdesktop/lockeng.cc | 23 | ||||
-rw-r--r-- | kdesktop/lockeng.h | 12 |
4 files changed, 42 insertions, 15 deletions
diff --git a/kdesktop/krootwm.cc b/kdesktop/krootwm.cc index 6ca1862b2..c14d1326c 100644 --- a/kdesktop/krootwm.cc +++ b/kdesktop/krootwm.cc @@ -83,7 +83,6 @@ KRootWm::KRootWm(SaverEngine* _saver, KDesktop* _desktop) : TQObject(_desktop), customMenu2 = 0; m_configDialog = 0; - // Creates the new menu menuBar = 0; // no menubar yet menuNew = 0; @@ -825,7 +824,6 @@ void KRootWm::slotCascadeWindows() { void KRootWm::slotLock() { m_pSaver->lockScreen(); - m_pSaver->waitForLockEngage(); } @@ -872,11 +870,7 @@ void KRootWm::slotPopulateSessions() void KRootWm::slotSessionActivated( int ent ) { if (ent > 0 && !sessionsMenu->isItemChecked( ent )) { - m_pSaver->lockScreen(); - if (!m_pSaver->waitForLockEngage()) { - return; - } - DM().switchVT( ent ); + m_pSaver->lockScreenAndSwitchSession(ent); } } @@ -914,13 +908,11 @@ void KRootWm::doNewSession( bool lock ) return; if (lock) { - m_pSaver->lockScreen(); - if (!m_pSaver->waitForLockEngage()) { - return; - } + m_pSaver->lockScreenAndDoNewSession(); + } + else { + DM().startReserve(); } - - DM().startReserve(); } void KRootWm::slotMenuItemActivated(int /* item */ ) diff --git a/kdesktop/lock/lockprocess.cc b/kdesktop/lock/lockprocess.cc index a4a2badd3..3e818a145 100644 --- a/kdesktop/lock/lockprocess.cc +++ b/kdesktop/lock/lockprocess.cc @@ -1991,8 +1991,8 @@ int LockProcess::execDialog( TQDialog *dlg ) else { bitBlt(this, 0, 0, &backingPixmap); } + saverReadyIfNeeded(); } - saverReadyIfNeeded(); // dlg->exec may generate BadMatch errors, so make sure they are silently ignored int (*oldHandler)(Display *, XErrorEvent *); oldHandler = XSetErrorHandler(ignoreXError); @@ -2091,7 +2091,7 @@ void LockProcess::slotPaintBackground(const TQPixmap &rpm) setGeometry(0, 0, mRootWidth, mRootHeight); erase(); } - saverReadyIfNeeded(); +// saverReadyIfNeeded(); } void LockProcess::preparePopup() diff --git a/kdesktop/lockeng.cc b/kdesktop/lockeng.cc index 6ce26cf4e..27b57bc51 100644 --- a/kdesktop/lockeng.cc +++ b/kdesktop/lockeng.cc @@ -22,6 +22,8 @@ #include <dcopclient.h> #include <assert.h> +#include <dmctl.h> + #include <dbus/dbus-shared.h> #include <tqdbusdata.h> #include <tqdbuserror.h> @@ -79,6 +81,8 @@ SaverEngine::SaverEngine() mSAKProcess(NULL), mTerminationRequested(false), mSaverProcessReady(false), + mNewVTAfterLockEngage(false), + mSwitchVTAfterLockEngage(-1), dBusLocal(0), dBusWatch(0), systemdSession(0) @@ -599,6 +603,15 @@ void SaverEngine::lockProcessFullyActivated() params << TQT_DBusData::fromBool(true); TQT_DBusMessage reply = systemdSession->sendWithReply("SetIdleHint", params); } + + if (mNewVTAfterLockEngage) { + DM().startReserve(); + mNewVTAfterLockEngage = false; + } + else if (mSwitchVTAfterLockEngage != -1) { + DM().switchVT(mSwitchVTAfterLockEngage); + mSwitchVTAfterLockEngage = -1; + } } void SaverEngine::slotLockProcessReady() @@ -854,6 +867,16 @@ bool SaverEngine::waitForLockEngage() { return mLockProcess.isRunning(); } +void SaverEngine::lockScreenAndDoNewSession() { + mNewVTAfterLockEngage = true; + lockScreen(); +} + +void SaverEngine::lockScreenAndSwitchSession(int vt) { + mSwitchVTAfterLockEngage = vt; + lockScreen(); +} + void SaverEngineThreadHelperObject::terminateThread() { TQEventLoop* eventLoop = TQApplication::eventLoop(); if (eventLoop) { diff --git a/kdesktop/lockeng.h b/kdesktop/lockeng.h index 9827090b4..166d6b40e 100644 --- a/kdesktop/lockeng.h +++ b/kdesktop/lockeng.h @@ -106,6 +106,16 @@ public: */ bool waitForLockEngage(); + /** + * @internal + */ + void lockScreenAndDoNewSession(); + + /** + * @internal + */ + void lockScreenAndSwitchSession(int vt); + signals: void terminateHelperThread(); void asyncLock(); @@ -175,6 +185,8 @@ private: TDEProcess* mSAKProcess; bool mTerminationRequested; bool mSaverProcessReady; + bool mNewVTAfterLockEngage; + int mSwitchVTAfterLockEngage; struct sigaction mSignalAction; TQT_DBusConnection dBusConn; TQT_DBusProxy* dBusLocal; |