summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLamarque V. Souza <lamarque@kde.org>2012-02-27 22:35:26 (GMT)
committerLamarque V. Souza <lamarque@kde.org>2012-02-27 22:38:21 (GMT)
commit82d5f2a118a9a40e18b86628a3dc3109adf4f7bc (patch)
treec00299bb15d79ccdb2d7d90ee748aac10a77b7f1
parent462c3ce99c2758c18f89e2c93f0a88675df1d68d (diff)
Add timeout for logoutSoundFinished() signal to prevent shutdown process
from stopping because of broken sound system. Thanks to Peter OGorman for pointing this problem out. REVIEW: 103593 BUG: 228005 (cherry picked from commit ad188bfdb06af50448acbbde00556ebc3d29f418)
-rw-r--r--ksmserver/server.h1
-rw-r--r--ksmserver/shutdown.cpp15
2 files changed, 16 insertions, 0 deletions
diff --git a/ksmserver/server.h b/ksmserver/server.h
index 412a73d..8e54221 100644
--- a/ksmserver/server.h
+++ b/ksmserver/server.h
@@ -126,6 +126,7 @@ private Q_SLOTS:
void kcmPhase1Timeout();
void kcmPhase2Timeout();
void pendingShutdownTimeout();
+ void logoutSoundTimeout();
void autoStart0();
void autoStart1();
diff --git a/ksmserver/shutdown.cpp b/ksmserver/shutdown.cpp
index 7fd1e11..5f6b9d8 100644
--- a/ksmserver/shutdown.cpp
+++ b/ksmserver/shutdown.cpp
@@ -460,6 +460,12 @@ void KSMServer::completeShutdownOrCheckpoint()
if ( state == Shutdown ) {
KNotification *n = KNotification::event( "exitkde" , QString() , QPixmap() , 0l , KNotification::DefaultEvent ); // KDE says good bye
connect(n, SIGNAL(closed()) , this, SLOT(logoutSoundFinished()) );
+ // https://bugs.kde.org/show_bug.cgi?id=228005
+ // if sound is not working for some reason (e.g. no phonon
+ // backends are installed) the closed() signal never happens
+ // and logoutSoundFinished() never gets called. Add this timer to make
+ // sure the shutdown procedure continues even if sound system is broken.
+ QTimer::singleShot(5000, this, SLOT(logoutSoundTimeout()));
kDebug( 1218 ) << "Starting logout event";
state = WaitingForKNotify;
createLogoutEffectWidget();
@@ -475,6 +481,15 @@ void KSMServer::completeShutdownOrCheckpoint()
}
+void KSMServer::logoutSoundTimeout()
+{
+ if (state != WaitingForKNotify) {
+ return;
+ }
+ kDebug( 1218 ) << "logout sound timeout";
+ logoutSoundFinished();
+}
+
void KSMServer::startKilling()
{
kDebug( 1218 ) << "Starting killing clients";