From 3eca9f067a77b752e0efc03f0ebc86fcd3b92d95 Mon Sep 17 00:00:00 2001 From: Nolan Darilek Date: Fri, 3 Jan 2025 14:08:21 -0500 Subject: [PATCH] fix: No need for *any* ctrl-c handling since Bevy already does the right thing. --- src/lib.rs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index 2404d46..ab174a1 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -1,10 +1,5 @@ -use bevy::app::ctrlc; #[allow(unused_imports)] -use bevy::{ - app::{AppExit, TerminalCtrlCHandlerPlugin}, - prelude::*, - window::WindowFocused, -}; +use bevy::{app::AppExit, prelude::*, window::WindowFocused}; #[cfg(windows)] use windows::{ core::GUID, @@ -30,13 +25,6 @@ fn setup(mut commands: Commands) { if let Some(active) = active.as_ref() { let scheme = DefaultScheme(*active); commands.insert_resource(scheme); - ctrlc::set_handler(move || { - Power::PowerSetActiveScheme(None, Some(active)) - .ok() - .expect("Failed to set power scheme"); - TerminalCtrlCHandlerPlugin::gracefully_exit(); - }) - .expect("Failed to set exit handler"); } } #[cfg(not(windows))]