summaryrefslogtreecommitdiffstats
path: root/ksmserver/shutdown.cpp
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-06-01 14:50:58 -0500
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2013-06-01 14:50:58 -0500
commit8f8dce368aa9470e8c6a53b6325d7a682d0dbb8a (patch)
tree24d533b561803eadbf4591f72f22236261f2459b /ksmserver/shutdown.cpp
parent8a865f7d591bb47948a24af081fc494530503461 (diff)
downloadtdebase-8f8dce368aa9470e8c6a53b6325d7a682d0dbb8a.tar.gz
tdebase-8f8dce368aa9470e8c6a53b6325d7a682d0dbb8a.zip
Fix premature termination of applications during shutdown on slow machines
Diffstat (limited to 'ksmserver/shutdown.cpp')
-rw-r--r--ksmserver/shutdown.cpp12
1 files changed, 10 insertions, 2 deletions
diff --git a/ksmserver/shutdown.cpp b/ksmserver/shutdown.cpp
index b48276f03..4f064ece3 100644
--- a/ksmserver/shutdown.cpp
+++ b/ksmserver/shutdown.cpp
@@ -98,6 +98,10 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
#define SHUTDOWN_MARKER(x)
#endif // PROFILE_SHUTDOWN
+// Time to wait after close request for graceful application termination
+// If set too high running applications may be ungracefully terminated on slow machines
+#define KSMSERVER_SHUTDOWN_CLIENT_UNRESPONSIVE_TIMEOUT 60000
+
void KSMServer::logout( int confirm, int sdtype, int sdmode )
{
shutdown( (TDEApplication::ShutdownConfirm)confirm,
@@ -505,7 +509,7 @@ void KSMServer::cancelShutdown( KSMClient* c )
void KSMServer::startProtection()
{
- protectionTimer.start( 10000, true );
+ protectionTimer.start( KSMSERVER_SHUTDOWN_CLIENT_UNRESPONSIVE_TIMEOUT, true );
}
void KSMServer::endProtection()
@@ -651,11 +655,15 @@ void KSMServer::startKilling()
kdDebug( 1218 ) << " We killed all clients. We have now clients.count()=" << clients.count() << endl;
completeKilling();
- TQTimer::singleShot( 10000, this, TQT_SLOT( timeoutQuit() ) );
+ shutdownTimer.start( KSMSERVER_SHUTDOWN_CLIENT_UNRESPONSIVE_TIMEOUT, TRUE );
}
void KSMServer::completeKilling()
{
+ // Activity detected; reset forcible shutdown timer...
+ if (shutdownTimer.isActive()) {
+ shutdownTimer.start( KSMSERVER_SHUTDOWN_CLIENT_UNRESPONSIVE_TIMEOUT, TRUE );
+ }
SHUTDOWN_MARKER("completeKilling");
kdDebug( 1218 ) << "KSMServer::completeKilling clients.count()=" << clients.count() << endl;
if( state == Killing ) {