summaryrefslogtreecommitdiff
path: root/Services/SystemMenu
diff options
context:
space:
mode:
authorsppmacd <42967349+sppmacd@users.noreply.github.com>2020-06-28 14:30:00 +0200
committerAndreas Kling <kling@serenityos.org>2020-06-28 14:32:17 +0200
commitabdf36b171e5ba3fe6d001cd3d45ae7a2df224ef (patch)
tree260cbc58365a29cabec4b42cd8336e289405e358 /Services/SystemMenu
parentb8dc1fc19537c5476b5a177b66f83ea69d31bfe7 (diff)
downloadserenity-abdf36b171e5ba3fe6d001cd3d45ae7a2df224ef.zip
SystemMenu: Fix shutdown dialog
It was shutting down even if selected Restart.
Diffstat (limited to 'Services/SystemMenu')
-rw-r--r--Services/SystemMenu/ShutdownDialog.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/Services/SystemMenu/ShutdownDialog.cpp b/Services/SystemMenu/ShutdownDialog.cpp
index 9d6a60ff11..eb85879251 100644
--- a/Services/SystemMenu/ShutdownDialog.cpp
+++ b/Services/SystemMenu/ShutdownDialog.cpp
@@ -51,9 +51,10 @@ static const Vector<Option> options = {
Vector<char const*> ShutdownDialog::show()
{
- auto rc = ShutdownDialog::construct()->exec();
- if (rc == ExecResult::ExecOK)
- return options[rc].cmd;
+ auto dialog = ShutdownDialog::construct();
+ auto rc = dialog->exec();
+ if (rc == ExecResult::ExecOK && dialog->m_selected_option != -1)
+ return options[dialog->m_selected_option].cmd;
return {};
}