mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-28 01:24:17 +00:00
gpui_macos: Fix deadlock during re-entrant key status changes (#51035)
Closes #50151 Before you mark this PR as ready for review, make sure that you have: - [ ] Added a solid test coverage and/or screenshots from doing manual testing - [x] Done a self-review taking into account security and performance aspects - [ ] Aligned any UI changes with the [UI checklist](https://github.com/zed-industries/zed/blob/main/CONTRIBUTING.md#uiux-checklist) Release Notes: - Fixed a deadlock that froze the entire app when opening a new window from a PopUp window or switching focus between multiple windows on macOS.
This commit is contained in:
parent
f1e7f397d7
commit
97049a76ba
1 changed files with 4 additions and 2 deletions
|
|
@ -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();
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue