From 1eb5bc816598318458e3a6459663af103a46094b Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 18 Jul 2013 10:22:48 -0500 Subject: Beautify logout process --- ksmserver/shutdown.cpp | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) (limited to 'ksmserver/shutdown.cpp') diff --git a/ksmserver/shutdown.cpp b/ksmserver/shutdown.cpp index 4f064ece3..5809cd295 100644 --- a/ksmserver/shutdown.cpp +++ b/ksmserver/shutdown.cpp @@ -706,15 +706,17 @@ void KSMServer::killWM() shutdownNotifierIPDlg=0; } for ( KSMClient* c = clients.first(); c; c = clients.next() ) { - if( isWM( c )) { + if( isNotifier( c )) { iswm = true; - kdDebug( 1218 ) << "killWM: client " << c->program() << "(" << c->clientId() << ")" << endl; SmsDie( c->connection() ); } if( isCM( c )) { + iswm = true; SmsDie( c->connection() ); } - if( isNotifier( c )) { + if( isWM( c )) { + iswm = true; + kdDebug( 1218 ) << "killWM: client " << c->program() << "(" << c->clientId() << ")" << endl; SmsDie( c->connection() ); } } @@ -742,7 +744,19 @@ void KSMServer::completeKillingWM() void KSMServer::killingCompleted() { SHUTDOWN_MARKER("killingCompleted"); - kapp->quit(); + DM dmObject; + int dmType = dmObject.type(); + if ((dmType == DM::NewTDM) || (dmType == DM::OldTDM) || (dmType == DM::GDM)) { + // Hide any remaining windows until the X server is terminated by the display manager + pid_t child; + child = fork(); + if (child != 0) { + kapp->quit(); + } + } + else { + kapp->quit(); + } } // called when KNotify performs notification for logout (not when sound is finished though) -- cgit v1.2.1