summaryrefslogtreecommitdiffstats
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
parent8a865f7d591bb47948a24af081fc494530503461 (diff)
downloadtdebase-8f8dce368aa9470e8c6a53b6325d7a682d0dbb8a.tar.gz
tdebase-8f8dce368aa9470e8c6a53b6325d7a682d0dbb8a.zip
Fix premature termination of applications during shutdown on slow machines
-rw-r--r--ksmserver/server.cpp1
-rw-r--r--ksmserver/server.h1
-rw-r--r--ksmserver/shutdown.cpp12
3 files changed, 12 insertions, 2 deletions
diff --git a/ksmserver/server.cpp b/ksmserver/server.cpp
index 1c9c18cec..214108fb4 100644
--- a/ksmserver/server.cpp
+++ b/ksmserver/server.cpp
@@ -682,6 +682,7 @@ KSMServer::KSMServer( const TQString& windowManager, const TQString& windowManag
connect( &protectionTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( protectionTimeout() ) );
connect( &restoreTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( tryRestoreNext() ) );
+ connect( &shutdownTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( timeoutQuit() ) );
connect( kapp, TQT_SIGNAL( shutDown() ), this, TQT_SLOT( cleanUp() ) );
}
diff --git a/ksmserver/server.h b/ksmserver/server.h
index ed608121c..00e3b7388 100644
--- a/ksmserver/server.h
+++ b/ksmserver/server.h
@@ -213,6 +213,7 @@ private:
TQCString launcher;
TQTimer protectionTimer;
TQTimer restoreTimer;
+ TQTimer shutdownTimer;
TQString xonCommand;
int logoutSoundEvent;
TQTimer knotifyTimeoutTimer;
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 ) {