mirror of
https://github.com/zed-industries/zed.git
synced 2024-10-27 00:41:37 +00:00
Ensure no borrows are held when activating window or creating prompts
This commit is contained in:
parent
d4e0f73ffe
commit
c53fa4941a
1 changed files with 21 additions and 6 deletions
|
@ -392,18 +392,33 @@ impl platform::Window for Window {
|
|||
});
|
||||
let block = block.copy();
|
||||
let native_window = self.0.borrow().native_window;
|
||||
let _: () = msg_send![
|
||||
alert,
|
||||
beginSheetModalForWindow: native_window
|
||||
completionHandler: block
|
||||
];
|
||||
self.0
|
||||
.borrow()
|
||||
.executor
|
||||
.spawn(async move {
|
||||
let _: () = msg_send![
|
||||
alert,
|
||||
beginSheetModalForWindow: native_window
|
||||
completionHandler: block
|
||||
];
|
||||
})
|
||||
.detach();
|
||||
|
||||
done_rx
|
||||
}
|
||||
}
|
||||
|
||||
fn activate(&self) {
|
||||
let window = self.0.borrow().native_window;
|
||||
unsafe { msg_send![window, makeKeyAndOrderFront: nil] }
|
||||
self.0
|
||||
.borrow()
|
||||
.executor
|
||||
.spawn(async move {
|
||||
unsafe {
|
||||
let _: () = msg_send![window, makeKeyAndOrderFront: nil];
|
||||
}
|
||||
})
|
||||
.detach();
|
||||
}
|
||||
|
||||
fn set_title(&mut self, title: &str) {
|
||||
|
|
Loading…
Reference in a new issue