From 6ede0fbe05573e7fdd992a96fd8cafcb2654e4a4 Mon Sep 17 00:00:00 2001 From: Ashley Wulber Date: Thu, 16 May 2024 19:32:28 -0400 Subject: [PATCH] fix(power): when restarting from the shutdown confirmation, skip the dialog --- cosmic-applet-power/src/lib.rs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/cosmic-applet-power/src/lib.rs b/cosmic-applet-power/src/lib.rs index 88df9c56..a49a4a19 100644 --- a/cosmic-applet-power/src/lib.rs +++ b/cosmic-applet-power/src/lib.rs @@ -172,7 +172,10 @@ impl cosmic::Application for Power { } Message::Action(action) => { // Ask for user confirmation of non-destructive actions only - if matches!(action, PowerAction::Lock | PowerAction::Suspend) { + if matches!(action, PowerAction::Lock | PowerAction::Suspend) + || matches!(action, PowerAction::Restart) + && matches!(self.action_to_confirm, Some((_, PowerAction::Shutdown, _))) + { action.perform() } else { let id = window::Id::unique();