summaryrefslogtreecommitdiffstats
path: root/kdesktop
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-04-23 14:59:01 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-04-23 14:59:01 -0500
commit67a3a8f34892a6491ba0073a3f583503b44e58e7 (patch)
tree7f3c81b5f0c6b65e0e00711831211c1475af9241 /kdesktop
parente72f4926c094b2bd94501518fbcd2a3e66a74f6a (diff)
downloadtdebase-67a3a8f34892a6491ba0073a3f583503b44e58e7.tar.gz
tdebase-67a3a8f34892a6491ba0073a3f583503b44e58e7.zip
Fix desktop lock failure due to race condition within signal handler between qt and xcb
Diffstat (limited to 'kdesktop')
-rw-r--r--kdesktop/lock/lockprocess.cc2
-rw-r--r--kdesktop/lock/main.cc2
-rw-r--r--kdesktop/lockeng.cc9
-rw-r--r--kdesktop/lockeng.h3
4 files changed, 13 insertions, 3 deletions
diff --git a/kdesktop/lock/lockprocess.cc b/kdesktop/lock/lockprocess.cc
index c0050d308..3c67ac06d 100644
--- a/kdesktop/lock/lockprocess.cc
+++ b/kdesktop/lock/lockprocess.cc
@@ -664,6 +664,7 @@ void LockProcess::startSecureDialog()
}
trinity_desktop_lock_in_sec_dlg = false;
if (ret == 0) {
+ trinity_desktop_lock_closing_windows = 1;
kapp->quit();
}
if (ret == 1) {
@@ -687,6 +688,7 @@ void LockProcess::startSecureDialog()
mBusy = false;
}
if (ret == 2) {
+ trinity_desktop_lock_closing_windows = 1;
if (system("ksysguard &") == -1) {
// Error handler to shut up gcc warnings
}
diff --git a/kdesktop/lock/main.cc b/kdesktop/lock/main.cc
index 5853da17a..225d9c5b4 100644
--- a/kdesktop/lock/main.cc
+++ b/kdesktop/lock/main.cc
@@ -266,7 +266,7 @@ int main( int argc, char **argv )
bool rt;
bool sig = false;
- if( (!child && (args->isSet( "forcelock" )) || (signalled_forcelock == TRUE))) {
+ if( (((!child) && (args->isSet( "forcelock" ))) || (signalled_forcelock == TRUE))) {
rt = process.lock();
sig = true;
}
diff --git a/kdesktop/lockeng.cc b/kdesktop/lockeng.cc
index 9eb88e1d1..f24d02f9f 100644
--- a/kdesktop/lockeng.cc
+++ b/kdesktop/lockeng.cc
@@ -34,7 +34,7 @@ SaverEngine* m_masterSaverEngine = NULL;
static void sigusr1_handler(int)
{
if (m_masterSaverEngine) {
- m_masterSaverEngine->lockProcessWaiting();
+ m_masterSaverEngine->slotLockProcessWaiting();
}
}
@@ -445,6 +445,13 @@ void SaverEngine::lockProcessExited()
}
}
+void SaverEngine::slotLockProcessWaiting()
+{
+ // lockProcessWaiting cannot be called directly from a signal handler, as it will hang in certain obscure circumstances
+ // Instead we use a single-shot timer to immediately call lockProcessWaiting once control has returned to the Qt main loop
+ TQTimer::singleShot(0, this, SLOT(lockProcessWaiting()));
+}
+
void SaverEngine::lockProcessWaiting()
{
kdDebug(1204) << "SaverEngine: lock exited" << endl;
diff --git a/kdesktop/lockeng.h b/kdesktop/lockeng.h
index ae08e9ad8..e42a048bb 100644
--- a/kdesktop/lockeng.h
+++ b/kdesktop/lockeng.h
@@ -79,11 +79,12 @@ public:
virtual void saverLockReady();
public slots:
- void lockProcessWaiting();
+ void slotLockProcessWaiting();
protected slots:
void idleTimeout();
void lockProcessExited();
+ void lockProcessWaiting();
private slots:
void handleSecureDialog();