diff --git a/crates/gpui_macos/src/window.rs b/crates/gpui_macos/src/window.rs index b783a4d083131fac70095d22718796ef761adee3..002c4719f768d698b5c8b599f039579cfe78640c 100644 --- a/crates/gpui_macos/src/window.rs +++ b/crates/gpui_macos/src/window.rs @@ -2113,10 +2113,12 @@ extern "C" fn window_did_change_key_status(this: &Object, selector: Sel, _: id) // in theory, we're not supposed to invoke this method manually but it balances out // the spurious `becomeKeyWindow` event and helps us work around that bug. if selector == sel!(windowDidBecomeKey:) && !is_active { + let native_window = lock.native_window; + drop(lock); unsafe { - let _: () = msg_send![lock.native_window, resignKeyWindow]; - return; + let _: () = msg_send![native_window, resignKeyWindow]; } + return; } let executor = lock.foreground_executor.clone();