Change summary
crates/gpui3/src/app.rs | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
Detailed changes
@@ -270,9 +270,11 @@ impl AppContext {
.take()
.unwrap()
.and_then(|id| FocusHandle::for_id(id, &cx.window.focus_handles));
- let event = FocusEvent { focused, blurred };
- for listener in &listeners {
- listener(&event, cx);
+ if focused.is_some() || blurred.is_some() {
+ let event = FocusEvent { focused, blurred };
+ for listener in &listeners {
+ listener(&event, cx);
+ }
}
listeners.extend(cx.window.focus_listeners.drain(..));