Commit c2ea0afb authored by David Edmundson's avatar David Edmundson
Browse files

Fallback to in-process prompt if logout prompt fails

KSmserver is currently very heavily tied to the shutdown prompt dialog.
On upgrades a user ends up in a situation where they have an old
ksmserver running but a newer shutdown dialog. This has caused issues
repeatedly in the past.

I want to make some changes to how the shutdown prompt is shown for
5.15. First step is making the old releases more robust.

Prompt looks ugly but a user will only see it at most once. Hopefully

Test Plan:
rm'd the greeter
Got an ugly messagebox instead of nothing

Reviewers: #plasma, broulik, ngraham

Reviewed By: #plasma, broulik

Subscribers: ngraham, broulik, plasma-devel

Tags: #plasma

Differential Revision:
parent 69dcd548
......@@ -215,9 +215,36 @@ void KSMServer::shutdown( KWorkSpace::ShutdownConfirm confirm,
const int resultPipe = pipeFds[0];
connect(p, static_cast<void (QProcess::*)(QProcess::ProcessError)>(&QProcess::error), this,
[this, resultPipe] {
[this, resultPipe, sdmode, sdtype] {
dialogActive = false;
auto fallbackPrompt = new QMessageBox;
fallbackPrompt->setAttribute(Qt::WA_DeleteOnClose, true);
fallbackPrompt->setStandardButtons(QMessageBox::Ok | QMessageBox::Cancel);
switch (sdtype) {
case KWorkSpace::ShutdownTypeHalt:
//i18nd is used as this patch was backported to an LTS with stable translations
fallbackPrompt->setText(i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Shutdown"));
case KWorkSpace::ShutdownTypeReboot:
fallbackPrompt->setText(i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Reboot"));
case KWorkSpace::ShutdownTypeNone:
fallbackPrompt->setText(i18nd("plasma_lookandfeel_org.kde.lookandfeel", "Logout"));
connect(fallbackPrompt, &QMessageBox::buttonClicked, this, [=](QAbstractButton *button) {
if (button != fallbackPrompt->button(QMessageBox::Ok)) {
shutdownType = sdtype;
shutdownMode = sdmode;
bootOption = QString();
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment