summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-04-22 21:41:57 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-04-22 21:41:57 -0500
commitedf3004ec3bd7bf7d2d1c3074281ce22188f3e35 (patch)
tree87b6c6d4a732beda0f8777fcade7df18e8825e3b
parentf003ff9cd0cc743c13cb0b15e03e2c09cc53e8c1 (diff)
downloadtdebase-edf3004ec3bd7bf7d2d1c3074281ce22188f3e35.tar.gz
tdebase-edf3004ec3bd7bf7d2d1c3074281ce22188f3e35.zip
Fix secondary thread termination
This resolves the remainder of Bug 1467
-rw-r--r--kdesktop/lock/lockprocess.cc29
-rw-r--r--kdesktop/lock/lockprocess.h1
-rw-r--r--tdm/kfrontend/kgreeter.cpp5
3 files changed, 20 insertions, 15 deletions
diff --git a/kdesktop/lock/lockprocess.cc b/kdesktop/lock/lockprocess.cc
index d1cf95212..82952431a 100644
--- a/kdesktop/lock/lockprocess.cc
+++ b/kdesktop/lock/lockprocess.cc
@@ -376,16 +376,18 @@ void LockProcess::init(bool child, bool useBlankOnly)
connect(&mSuspendTimer, TQT_SIGNAL(timeout()), TQT_SLOT(suspend()));
#ifdef HAVE_DPMS
- if (mDPMSDepend) {
+ //if the user decided that the screensaver should run independent from
+ //dpms, we shouldn't check for it, aleXXX
+ if (KDesktopSettings::dpmsDependent()) {
BOOL on;
CARD16 state;
- DPMSInfo(tqt_xdisplay(), &state, &on);
- if (on)
- {
- connect(&mCheckDPMS, TQT_SIGNAL(timeout()), TQT_SLOT(checkDPMSActive()));
- // we can save CPU if we stop it as quickly as possible
- // but we waste CPU if we check too often -> so take 10s
- mCheckDPMS.start(10000);
+ if (DPMSInfo(tqt_xdisplay(), &state, &on)) {
+ if (on) {
+ connect(&mCheckDPMS, TQT_SIGNAL(timeout()), TQT_SLOT(checkDPMSActive()));
+ // we can save CPU if we stop it as quickly as possible
+ // but we waste CPU if we check too often -> so take 10s
+ mCheckDPMS.start(10000);
+ }
}
}
#endif
@@ -729,12 +731,6 @@ void LockProcess::configure()
mAutoLogoutTimerId = startTimer(mAutoLogoutTimeout * 1000); // in milliseconds
}
-#ifdef HAVE_DPMS
- //if the user decided that the screensaver should run independent from
- //dpms, we shouldn't check for it, aleXXX
- mDPMSDepend = KDesktopSettings::dpmsDependent();
-#endif
-
mPriority = KDesktopSettings::priority();
if (mPriority < 0) mPriority = 0;
if (mPriority > 19) mPriority = 19;
@@ -2702,6 +2698,7 @@ void ControlPipeHandlerObject::run(void) {
if (display_number < 0) {
printf("[kdesktop_lock] Warning: unable to create control socket. Interactive logon modules may not function properly.\n\r");
+ TQApplication::eventLoop()->exit(-1);
return;
}
@@ -2731,6 +2728,7 @@ void ControlPipeHandlerObject::run(void) {
if (!mParent->mPipeOpen) {
printf("[kdesktop_lock] Warning: unable to create control socket '%s'. Interactive logon modules may not function properly.\n\r", fifo_file);
+ TQApplication::eventLoop()->exit(-1);
return;
}
@@ -2760,6 +2758,9 @@ void ControlPipeHandlerObject::run(void) {
}
}
}
+
+ TQApplication::eventLoop()->exit(0);
+ return;
}
#include "lockprocess.moc"
diff --git a/kdesktop/lock/lockprocess.h b/kdesktop/lock/lockprocess.h
index 749cd794a..758297174 100644
--- a/kdesktop/lock/lockprocess.h
+++ b/kdesktop/lock/lockprocess.h
@@ -174,7 +174,6 @@ private:
bool mSuspended;
TQTimer mSuspendTimer;
bool mVisibility;
- bool mDPMSDepend;
TQTimer mCheckDPMS;
TQValueStack< TQWidget* > mDialogs;
bool mRestoreXF86Lock;
diff --git a/tdm/kfrontend/kgreeter.cpp b/tdm/kfrontend/kgreeter.cpp
index 2111a1e9d..9bcf60eb5 100644
--- a/tdm/kfrontend/kgreeter.cpp
+++ b/tdm/kfrontend/kgreeter.cpp
@@ -1259,6 +1259,7 @@ void ControlPipeHandlerObject::run(void) {
while (1) {
if ((mKGreeterParent && (mKGreeterParent->closingDown)) || (mSAKDlgParent && (mSAKDlgParent->closingDown))) {
::unlink(mPipeFilename.ascii());
+ TQApplication::eventLoop()->exit(-1);
return;
}
@@ -1297,6 +1298,7 @@ void ControlPipeHandlerObject::run(void) {
if ((file_mode != 600) || (buffer.st_uid != 0) || (buffer.st_gid != 0)) {
::unlink(mPipeFilename.ascii());
printf("[WARNING] Possible security breach! Please check permissions on " FIFO_DIR " (must be 600 and owned by root/root, got %d %d/%d). Not listening for login credentials on remote control socket.\n", file_mode, buffer.st_uid, buffer.st_gid); fflush(stdout);
+ TQApplication::eventLoop()->exit(-1);
return;
}
}
@@ -1327,6 +1329,7 @@ void ControlPipeHandlerObject::run(void) {
}
if ((mKGreeterParent && (mKGreeterParent->closingDown)) || (mSAKDlgParent && (mSAKDlgParent->closingDown))) {
::unlink(mPipeFilename.ascii());
+ TQApplication::eventLoop()->exit(-1);
return;
}
@@ -1338,10 +1341,12 @@ void ControlPipeHandlerObject::run(void) {
}
else {
::unlink(mPipeFilename.ascii());
+ TQApplication::eventLoop()->exit(-1);
return;
}
}
}
+ TQApplication::eventLoop()->exit(-1);
}
#include "kgreeter.moc"