mirror of
https://bitbucket.org/smil3y/kde-workspace.git
synced 2025-02-24 02:42:50 +00:00
plasma: queue logout if one is requested during initialization
that brings it mostly on par with the old session management implementation Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
44129102c6
commit
6f8ca7decb
2 changed files with 17 additions and 4 deletions
|
@ -119,6 +119,8 @@ PlasmaApp::PlasmaApp()
|
||||||
m_wmProc(nullptr),
|
m_wmProc(nullptr),
|
||||||
m_startupSuspend(0),
|
m_startupSuspend(0),
|
||||||
m_dialogActive(false),
|
m_dialogActive(false),
|
||||||
|
m_logoutAfterStartup(false),
|
||||||
|
m_confirm(0),
|
||||||
m_sdtype(KWorkSpace::ShutdownTypeNone),
|
m_sdtype(KWorkSpace::ShutdownTypeNone),
|
||||||
m_sessionManager(false)
|
m_sessionManager(false)
|
||||||
{
|
{
|
||||||
|
@ -1103,10 +1105,15 @@ void PlasmaApp::resumeStartup(const QString &app)
|
||||||
|
|
||||||
void PlasmaApp::logout(int confirm, int sdtype)
|
void PlasmaApp::logout(int confirm, int sdtype)
|
||||||
{
|
{
|
||||||
// TODO: prevent logout while initializing
|
m_confirm = confirm;
|
||||||
kDebug() << "logout" << confirm << sdtype;
|
|
||||||
m_sdtype = static_cast<KWorkSpace::ShutdownType>(sdtype);
|
m_sdtype = static_cast<KWorkSpace::ShutdownType>(sdtype);
|
||||||
if (confirm == KWorkSpace::ShutdownConfirmNo) {
|
if (m_phaseTimer) {
|
||||||
|
kDebug() << "logout queued" << m_confirm << m_sdtype;
|
||||||
|
m_logoutAfterStartup = true;
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
kDebug() << "logout" << m_confirm << m_sdtype;
|
||||||
|
if (m_confirm == KWorkSpace::ShutdownConfirmNo) {
|
||||||
QTimer::singleShot(s_sessiondelay, this, SLOT(saveClients()));
|
QTimer::singleShot(s_sessiondelay, this, SLOT(saveClients()));
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
@ -1217,7 +1224,11 @@ void PlasmaApp::nextPhase()
|
||||||
}
|
}
|
||||||
kDebug() << "startup done";
|
kDebug() << "startup done";
|
||||||
KNotification::event("kde/startkde");
|
KNotification::event("kde/startkde");
|
||||||
break;
|
if (m_logoutAfterStartup) {
|
||||||
|
kDebug() << "starting queued logout" << m_confirm << m_sdtype;
|
||||||
|
logout(m_confirm, m_sdtype);
|
||||||
|
}
|
||||||
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
m_phase++;
|
m_phase++;
|
||||||
|
|
|
@ -174,6 +174,8 @@ private:
|
||||||
QProcess* m_wmProc;
|
QProcess* m_wmProc;
|
||||||
int m_startupSuspend;
|
int m_startupSuspend;
|
||||||
bool m_dialogActive;
|
bool m_dialogActive;
|
||||||
|
bool m_logoutAfterStartup;
|
||||||
|
int m_confirm;
|
||||||
KWorkSpace::ShutdownType m_sdtype;
|
KWorkSpace::ShutdownType m_sdtype;
|
||||||
bool m_sessionManager;
|
bool m_sessionManager;
|
||||||
QList<org::kde::KApplication*> m_clients;
|
QList<org::kde::KApplication*> m_clients;
|
||||||
|
|
Loading…
Add table
Reference in a new issue