mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03:00
Fix panic when deploying emoji picker (character palette)
The panic was caused by Cocoa synchronously invoking the `selected_text_range` method on the registered input handler while we already had a borrow of the app. This commit fixes this issue by showing the character palette on the next tick of the loop (we've had this problem in other spots too and used the same technique).
This commit is contained in:
parent
961d8331f3
commit
9a6688bdfb
@ -886,11 +886,16 @@ impl PlatformWindow for MacWindow {
|
||||
}
|
||||
|
||||
fn show_character_palette(&self) {
|
||||
unsafe {
|
||||
let app = NSApplication::sharedApplication(nil);
|
||||
let window = self.0.lock().native_window;
|
||||
let _: () = msg_send![app, orderFrontCharacterPalette: window];
|
||||
}
|
||||
let this = self.0.lock();
|
||||
let window = this.native_window;
|
||||
this.executor
|
||||
.spawn(async move {
|
||||
unsafe {
|
||||
let app = NSApplication::sharedApplication(nil);
|
||||
let _: () = msg_send![app, orderFrontCharacterPalette: window];
|
||||
}
|
||||
})
|
||||
.detach();
|
||||
}
|
||||
|
||||
fn minimize(&self) {
|
||||
|
Loading…
Reference in New Issue
Block a user