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 block = block.copy();
|
||||||
let native_window = self.0.borrow().native_window;
|
let native_window = self.0.borrow().native_window;
|
||||||
let _: () = msg_send![
|
self.0
|
||||||
alert,
|
.borrow()
|
||||||
beginSheetModalForWindow: native_window
|
.executor
|
||||||
completionHandler: block
|
.spawn(async move {
|
||||||
];
|
let _: () = msg_send![
|
||||||
|
alert,
|
||||||
|
beginSheetModalForWindow: native_window
|
||||||
|
completionHandler: block
|
||||||
|
];
|
||||||
|
})
|
||||||
|
.detach();
|
||||||
|
|
||||||
done_rx
|
done_rx
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn activate(&self) {
|
fn activate(&self) {
|
||||||
let window = self.0.borrow().native_window;
|
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) {
|
fn set_title(&mut self, title: &str) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue