From b2dacef1e97dc3713a76a055eed24607fb7aa8de Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Sat, 11 Feb 2012 15:14:55 -0600 Subject: [PATCH] Terminate kwin manager unless a TDE or failsafe session was selected This closes Bug 824 (cherry picked from commit a305c0832688209d5359c212be92f54df9561ecc) --- kdm/kfrontend/kgapp.cpp | 11 +++++++++-- kdm/kfrontend/kgreeter.cpp | 2 ++ kdm/kfrontend/kgreeter.h | 2 +- 3 files changed, 12 insertions(+), 3 deletions(-) diff --git a/kdm/kfrontend/kgapp.cpp b/kdm/kfrontend/kgapp.cpp index b9038f698..b9461dbdf 100644 --- a/kdm/kfrontend/kgapp.cpp +++ b/kdm/kfrontend/kgapp.cpp @@ -257,6 +257,7 @@ kg_main( const char *argv0 ) XSetIOErrorHandler( xIOErr ); TQString login_user; + TQString login_session_wm; Display *dpy = qt_xdisplay(); @@ -409,6 +410,7 @@ kg_main( const char *argv0 ) Debug( "left event loop\n" ); login_user = static_cast(dialog)->curUser; + login_session_wm = static_cast(dialog)->curWMSession; if (rslt != ex_greet) { delete dialog; @@ -451,8 +453,13 @@ kg_main( const char *argv0 ) delete comp; } if (kwin) { - kwin->closeStdin(); - kwin->detach(); + if (login_session_wm.endsWith("/startkde") || (login_session_wm == "failsafe")) { + kwin->closeStdin(); + kwin->detach(); + } + else { + kwin->kill(); + } delete kwin; } delete proc; diff --git a/kdm/kfrontend/kgreeter.cpp b/kdm/kfrontend/kgreeter.cpp index 5877cb6c7..07e9e3f70 100644 --- a/kdm/kfrontend/kgreeter.cpp +++ b/kdm/kfrontend/kgreeter.cpp @@ -842,10 +842,12 @@ KGreeter::verifyOk() GSendInt( G_PutDmrc ); GSendStr( "Session" ); GSendStr( sessionTypes[curSel].type.utf8() ); + curWMSession = sessionTypes[curSel].type.utf8(); } else if (!prevValid) { GSendInt( G_PutDmrc ); GSendStr( "Session" ); GSendStr( "default" ); + curWMSession = sessionTypes[curSel].type.utf8(); } GSendInt( G_Ready ); closingDown = true; diff --git a/kdm/kfrontend/kgreeter.h b/kdm/kfrontend/kgreeter.h index 8ec8dd9c1..dc0cef044 100644 --- a/kdm/kfrontend/kgreeter.h +++ b/kdm/kfrontend/kgreeter.h @@ -75,7 +75,7 @@ class KGreeter : public KGDialog, public KGVerifyHandler { void handleInputPipe(); public: - TQString curUser, dName; + TQString curUser, curWMSession, dName; protected: void readFacesList();