Version: (using KDE KDE 3.5.4) Installed from: Mandriva RPMs OS: Linux I always keep a few windows open:konquerors, a konsole, a text file which are saved at session saving. But when I end the session, or shutdown, for a few seconds the minimized windows pop up again. This is very annoying and ugly. It feels buggy. When I press on End session or on Shutdown, the next thing I want to see is the login screen or the console messages of shutdown. (In Windows Vista the screen fades away when you shutdown, I like that.) vatbier
SVN commit 645393 by lunakl: Instead of killing the WM first during shutdown in order to prevent it from updating window-specific settings because of changes done during shutdown, kill it last in order to avoid flicker. KWin will automatically suspend updating window-specific settings during shutdown. BUG: 135501 M +3 -1 server.cpp M +4 -1 server.h M +49 -37 shutdown.cpp --- trunk/KDE/kdebase/workspace/ksmserver/server.cpp #645392:645393 @@ -778,8 +778,10 @@ delete client; if ( state == Shutdown || state == Checkpoint ) completeShutdownOrCheckpoint(); - if ( state == KillingWM || state == Killing ) + if ( state == Killing ) completeKilling(); + if ( state == KillingWM ) + completeKillingWM(); } void KSMServer::newConnection( int /*socket*/ ) --- trunk/KDE/kdebase/workspace/ksmserver/server.h #645392:645393 @@ -114,7 +114,10 @@ void startKilling(); void performStandardKilling(); void completeKilling(); + void killWM(); + void completeKillingWM(); void cancelShutdown( KSMClient* c ); + void killingCompleted(); void discardSession(); void storeSession(); @@ -160,7 +163,7 @@ { Idle, LaunchingWM, AutoStart0, KcmInitPhase1, AutoStart1, Restoring, FinishingStartup, // startup - Shutdown, Checkpoint, KillingWM, Killing, WaitingForKNotify // shutdown + Shutdown, Checkpoint, Killing, KillingWM, WaitingForKNotify // shutdown }; State state; bool dialogActive; --- trunk/KDE/kdebase/workspace/ksmserver/shutdown.cpp #645392:645393 @@ -452,27 +452,10 @@ void KSMServer::startKilling() { - state = KillingWM; -// kill the WM first, so that it doesn't track changes that happen as a result of other -// clients going away (e.g. if KWin is set to remember position of a window, it could -// shift because of Kicker going away and KWin would remember wrong position) - foreach( KSMClient* c, clients ) { - if( isWM( c )) { - kDebug( 1218 ) << "Killing WM: " << c->program() << "(" << c->clientId() << ")" << endl; - QTimer::singleShot( 2000, this, SLOT( timeoutWMQuit())); - SmsDie( c->connection()); - return; - } - } - performStandardKilling(); -} - -void KSMServer::performStandardKilling() -{ // kill all clients state = Killing; foreach( KSMClient* c, clients ) { - if( isWM( c )) + if( isWM( c )) // kill the WM as the last one in order to reduce flicker continue; kDebug( 1218 ) << "completeShutdown: client " << c->program() << "(" << c->clientId() << ")" << endl; SmsDie( c->connection() ); @@ -489,23 +472,53 @@ kDebug( 1218 ) << "KSMServer::completeKilling clients.count()=" << clients.count() << endl; if( state == Killing ) { - if ( clients.isEmpty() ) { - kapp->quit(); - } - return; - } - if( state == KillingWM ) { - bool iswm = false; + bool wait = false; foreach( KSMClient* c, clients ) { if( isWM( c )) - iswm = true; + continue; + wait = true; // still waiting for clients to go away } - if( !iswm ) - performStandardKilling(); + if( wait ) + return; + killWM(); } } +void KSMServer::killWM() +{ + state = KillingWM; + bool iswm = false; + foreach( KSMClient* c, clients ) { + if( isWM( c )) { + iswm = true; + kDebug( 1218 ) << "killWM: client " << c->program() << "(" << c->clientId() << ")" << endl; + SmsDie( c->connection() ); + } + } + if( iswm ) { + completeKillingWM(); + QTimer::singleShot( 5000, this, SLOT( timeoutWMQuit() ) ); + } + else + killingCompleted(); +} + +void KSMServer::completeKillingWM() +{ + kDebug( 1218 ) << "KSMServer::completeKillingWM clients.count()=" << + clients.count() << endl; + if( state == KillingWM ) { + if( clients.isEmpty()) + killingCompleted(); + } +} +// shutdown is fully complete +void KSMServer::killingCompleted() +{ + kapp->quit(); +} + void KSMServer::logoutSoundFinished( ) { if( state != WaitingForKNotify ) @@ -513,19 +526,18 @@ startKilling(); } +void KSMServer::timeoutQuit() +{ + foreach( KSMClient* c, clients ) { + kWarning( 1218 ) << "SmsDie timeout, client " << c->program() << "(" << c->clientId() << ")" << endl; + } + killWM(); +} void KSMServer::timeoutWMQuit() { if( state == KillingWM ) { kWarning( 1218 ) << "SmsDie WM timeout" << endl; - performStandardKilling(); } + killingCompleted(); } - -void KSMServer::timeoutQuit() -{ - foreach( KSMClient* c, clients ) { - kWarning( 1218 ) << "SmsDie timeout, client " << c->program() << "(" << c->clientId() << ")" << endl; - } - kapp->quit(); -}