-
-
Notifications
You must be signed in to change notification settings - Fork 4.5k
Regreesion: bevy:: window ::close_on_esc doesn't work correctly #7612
Copy link
Copy link
Closed
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenA-WindowingPlatform-agnostic interface layer to run your app inPlatform-agnostic interface layer to run your app inC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behavior
Milestone
Description
Bevy version
Main
Commit: 9ef840e
Relevant system information
- SystemInfo { os: "MacOS 13.2 ", kernel: "22.3.0", cpu: "Apple M1" }
What you did
I was looking at the new examples and I came across this system:
bevy::window::close_on_esc
pub fn close_on_esc(
mut commands: Commands,
focused_windows: Query<(Entity, &Window)>,
input: Res<Input<KeyCode>>,
) {
for (window, focus) in focused_windows.iter() {
if !focus.focused {
continue;
}
if input.just_pressed(KeyCode::Escape) {
commands.entity(window).despawn();
}
}
}
What went wrong
It doesn't close the window when I press Esc.
I have to click outside the window and back inside the window and it works.
Additional information
- It works fine in 0.9.1
- When I print
focus.focusedit says false, it doesn't seem to detect focus the first time I run the program.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
A-RenderingDrawing game state to the screenDrawing game state to the screenA-WindowingPlatform-agnostic interface layer to run your app inPlatform-agnostic interface layer to run your app inC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behavior