From 1f40ada72d693d681ec6a32c2ef717e8dd73b5bb Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 10 Sep 2011 22:32:00 +0000 Subject: Force windows with the modal system notification atom set to stay above other windows Enhance logout sequence appearance Add remote folder synchronization on logout support Fix flickering to black window with subsequent partial repaint of certain widgets occurring during fancy logout sequence git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdebase@1252640 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- ksmserver/shutdown.cpp | 27 ++++++++++++++++++++++++--- 1 file changed, 24 insertions(+), 3 deletions(-) (limited to 'ksmserver/shutdown.cpp') diff --git a/ksmserver/shutdown.cpp b/ksmserver/shutdown.cpp index a153b2806..b5e40a50b 100644 --- a/ksmserver/shutdown.cpp +++ b/ksmserver/shutdown.cpp @@ -81,6 +81,8 @@ CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. #include #include +#include + #include "server.h" #include "global.h" #include "shutdowndlg.h" @@ -182,6 +184,7 @@ void KSMServer::shutdownInternal( KApplication::ShutdownConfirm confirm, shutdownType = sdtype; shutdownMode = sdmode; bootOption = bopt; + shutdownNotifierIPDlg = 0; // shall we save the session on logout? saveSession = ( config->readEntry( "loginMode", "restorePreviousLogout" ) == "restorePreviousLogout" ); @@ -189,6 +192,19 @@ void KSMServer::shutdownInternal( KApplication::ShutdownConfirm confirm, if (showFancyLogout) { KSMShutdownIPFeedback::showit(); // hide the UGLY logout process from the user shutdownNotifierIPDlg = KSMShutdownIPDlg::showShutdownIP(); + while (!KSMShutdownIPFeedback::ispainted()) { + tqApp->processEvents(); + } + } + + // synchronize any folders that were requested for shutdown sync + if (shutdownNotifierIPDlg) { + static_cast(shutdownNotifierIPDlg)->setStatusMessage(i18n("Synchronizing remote folders").append("...")); + } + KRsync krs(this, ""); + krs.executeLogoutAutoSync(); + if (shutdownNotifierIPDlg) { + static_cast(shutdownNotifierIPDlg)->setStatusMessage(""); } if ( saveSession ) @@ -196,7 +212,9 @@ void KSMServer::shutdownInternal( KApplication::ShutdownConfirm confirm, // Set the real desktop background to black so that exit looks // clean regardless of what was on "our" desktop. - TQT_TQWIDGET(kapp->desktop())->setBackgroundColor( Qt::black ); + if (!showFancyLogout) { + TQT_TQWIDGET(kapp->desktop())->setBackgroundColor( Qt::black ); + } state = Shutdown; wmPhase1WaitingCount = 0; saveType = saveSession?SmSaveBoth:SmSaveGlobal; @@ -520,7 +538,7 @@ void KSMServer::startKilling() // kill all clients state = Killing; for ( KSMClient* c = clients.first(); c; c = clients.next() ) { - if( isWM( c )) // kill the WM as the last one in order to reduce flicker + if( isWM( c ) || isCM( c ) ) // kill the WM and CM as the last one in order to reduce flicker continue; kdDebug( 1218 ) << "completeShutdown: client " << c->program() << "(" << c->clientId() << ")" << endl; SmsDie( c->connection() ); @@ -539,7 +557,7 @@ void KSMServer::completeKilling() if( state == Killing ) { bool wait = false; for( KSMClient* c = clients.first(); c; c = clients.next()) { - if( isWM( c )) + if( isWM( c ) || isCM( c ) ) continue; wait = true; // still waiting for clients to go away } @@ -563,6 +581,9 @@ void KSMServer::killWM() kdDebug( 1218 ) << "killWM: client " << c->program() << "(" << c->clientId() << ")" << endl; SmsDie( c->connection() ); } + if( isCM( c )) { + SmsDie( c->connection() ); + } } if( iswm ) { completeKillingWM(); -- cgit v1.2.3