diff --git a/CHANGELOG.md b/CHANGELOG.md index b9b08085..ffc58f6a 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,7 @@ # Unreleased +- On Android, calling `WindowEvent::Focused` now works properly instead of always returning false. + # 0.23.0 (2020-10-02) - On iOS, fixed support for the "Debug View Heirarchy" feature in Xcode. diff --git a/src/platform_impl/android/mod.rs b/src/platform_impl/android/mod.rs index 471dd15d..be19af4f 100644 --- a/src/platform_impl/android/mod.rs +++ b/src/platform_impl/android/mod.rs @@ -148,6 +148,28 @@ impl EventLoop { ); } } + Event::WindowHasFocus => { + call_event_handler!( + event_handler, + self.window_target(), + control_flow, + event::Event::WindowEvent { + window_id: window::WindowId(WindowId), + event: event::WindowEvent::Focused(true), + } + ); + } + Event::WindowLostFocus => { + call_event_handler!( + event_handler, + self.window_target(), + control_flow, + event::Event::WindowEvent { + window_id: window::WindowId(WindowId), + event: event::WindowEvent::Focused(false), + } + ); + } _ => {} }, Some(EventSource::InputQueue) => {