diff --git a/crates/gpui3/src/app.rs b/crates/gpui3/src/app.rs index 663995e8935c2d523a575c843ee5d7cc8b223aef..f2033514fa8dac8c024f0c324f88cff13e4f63d4 100644 --- a/crates/gpui3/src/app.rs +++ b/crates/gpui3/src/app.rs @@ -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(..));