Fix to sending key signals when window focus lost (#845)

When window focus has just been lost, key pressed events aren't ignored
macos-click-through
Lucas Miranda 3 years ago committed by GitHub
parent 0c1a7029e3
commit 0d6cfd54cb
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -32,12 +32,12 @@ impl KeyboardManager {
pub fn handle_event(&mut self, event: &Event<()>) { pub fn handle_event(&mut self, event: &Event<()>) {
match event { match event {
Event::WindowEvent { Event::WindowEvent {
event: WindowEvent::Focused(focused), event: WindowEvent::Focused(_focused),
.. ..
} => { } => {
// The window was just focused, so ignore keyboard events that were submitted this // When window is just focused or lost it's focus, ignore keyboard events
// frame. // that were submitted this frame
self.ignore_input_this_frame = *focused; self.ignore_input_this_frame = true;
} }
Event::WindowEvent { Event::WindowEvent {
event: event:

Loading…
Cancel
Save