mirror of
https://github.com/lightsoutgames/bevy_full_throttle
synced 2025-01-22 13:45:57 +00:00
fix: No need for *any* ctrl-c handling since Bevy already does the right thing.
This commit is contained in:
parent
fb63b2ba79
commit
3eca9f067a
14
src/lib.rs
14
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))]
|
||||
|
|
Loading…
Reference in New Issue
Block a user