mirror of
https://github.com/lightsoutgames/bevy_full_throttle
synced 2025-01-22 13:25:56 +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)]
|
#[allow(unused_imports)]
|
||||||
use bevy::{
|
use bevy::{app::AppExit, prelude::*, window::WindowFocused};
|
||||||
app::{AppExit, TerminalCtrlCHandlerPlugin},
|
|
||||||
prelude::*,
|
|
||||||
window::WindowFocused,
|
|
||||||
};
|
|
||||||
#[cfg(windows)]
|
#[cfg(windows)]
|
||||||
use windows::{
|
use windows::{
|
||||||
core::GUID,
|
core::GUID,
|
||||||
|
@ -30,13 +25,6 @@ fn setup(mut commands: Commands) {
|
||||||
if let Some(active) = active.as_ref() {
|
if let Some(active) = active.as_ref() {
|
||||||
let scheme = DefaultScheme(*active);
|
let scheme = DefaultScheme(*active);
|
||||||
commands.insert_resource(scheme);
|
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))]
|
#[cfg(not(windows))]
|
||||||
|
|
Loading…
Reference in New Issue
Block a user