From da560698f1098a4ebca54ead7436110003f2a716 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 8 Aug 2013 00:01:35 -0500 Subject: [PATCH] Fix logout dialog appearing during client interaction --- ksmserver/shutdown.cpp | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/ksmserver/shutdown.cpp b/ksmserver/shutdown.cpp index 8af8f0450..cf849e757 100644 --- a/ksmserver/shutdown.cpp +++ b/ksmserver/shutdown.cpp @@ -439,6 +439,7 @@ void KSMServer::saveYourselfDone( KSMClient* client, bool success ) } } + notificationTimer.stop(); updateLogoutStatusDialog(); } @@ -454,6 +455,9 @@ void KSMServer::updateLogoutStatusDialog() pendingInteraction = true; } } + if (clientInteracting) { + pendingInteraction = true; + } if (shutdownNotifierIPDlg) { int waitingClients = 0; @@ -477,6 +481,9 @@ void KSMServer::updateLogoutStatusDialog() } if (inPhase2) { if (phase2ClientCount > 0) { + if (!notificationTimer.isActive()) { + notificationTimer.start( KSMSERVER_NOTIFICATION_MANUAL_OPTIONS_TIMEOUT, true ); + } static_cast(shutdownNotifierIPDlg)->show(); static_cast(shutdownNotifierIPDlg)->setNotificationActionButtonsSkipText(i18n("Skip Notification (%1)").arg(((KSMSERVER_SHUTDOWN_CLIENT_UNRESPONSIVE_TIMEOUT - (protectionTimerCounter*1000))/1000)+1)); if (nextClientToKill == "") { @@ -489,8 +496,16 @@ void KSMServer::updateLogoutStatusDialog() } else { if (pendingInteraction) { - static_cast(shutdownNotifierIPDlg)->hide(); +#if 0 static_cast(shutdownNotifierIPDlg)->setNotificationActionButtonsSkipText(i18n("Ignore and Resume Logout")); +#else + // Hide dialog and buttons + static_cast(shutdownNotifierIPDlg)->hide(); + notificationTimer.stop(); + static_cast(shutdownNotifierIPDlg)->hideNotificationActionButtons(); + disconnect(shutdownNotifierIPDlg, SIGNAL(abortLogoutClicked()), this, SLOT(cancelShutdown())); + disconnect(shutdownNotifierIPDlg, SIGNAL(skipNotificationClicked()), this, SLOT(forceSkipSaveYourself())); +#endif if (nextClientToKill == "") { static_cast(shutdownNotifierIPDlg)->setStatusMessage(i18n("An application is requesting attention, logout paused...")); } @@ -499,6 +514,9 @@ void KSMServer::updateLogoutStatusDialog() } } else { + if (!notificationTimer.isActive()) { + notificationTimer.start( KSMSERVER_NOTIFICATION_MANUAL_OPTIONS_TIMEOUT, true ); + } static_cast(shutdownNotifierIPDlg)->show(); static_cast(shutdownNotifierIPDlg)->setNotificationActionButtonsSkipText(i18n("Skip Notification (%1)").arg(((KSMSERVER_SHUTDOWN_CLIENT_UNRESPONSIVE_TIMEOUT - (protectionTimerCounter*1000))/1000)+1)); if (nextClientToKill == "") {