diff --git a/examples/layer_shell_window.rs b/examples/layer_shell_window.rs index aa2ec7d..ff9e592 100644 --- a/examples/layer_shell_window.rs +++ b/examples/layer_shell_window.rs @@ -6,7 +6,7 @@ use bevy::{ window::{WindowCreated, WindowResolution}, winit::WinitPlugin, }; -use bevy_wayland::{layer_shell::LayerShellSettings, WaylandPlugin}; +use bevy_wayland::{input_region::InputRegion, layer_shell::LayerShellSettings, WaylandPlugin}; use smithay_client_toolkit::shell::wlr_layer::{Anchor, Layer}; const NORMAL_BUTTON: Color = Color::srgb(0.15, 0.15, 0.15); @@ -30,7 +30,10 @@ fn main() { )) .init_resource::() .add_systems(Startup, setup) - .add_systems(Update, (button_system, setup_new_window, spawn_window)) + .add_systems( + Update, + (button_system, spawn_window, setup_new_window, exit_on_esc), + ) .run(); } @@ -75,11 +78,11 @@ fn setup(mut commands: Commands, assets: Res, windows: Query, windows: Query>) { + if keys.just_pressed(KeyCode::Escape) { + std::process::exit(0); + } +} + fn spawn_window( mut commands: Commands, mut windows: Query<(Entity, &mut WindowTimer)>, mut new_window_info: ResMut, + keys: Res>, time: Res