Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

Fix panic in update_ime_position (#21510)

Conrad Irwine231321655a1
diff --git a/crates/gpui/src/platform/mac/window.rs b/crates/gpui/src/platform/mac/window.rs
index 9266f81f74a..8ea7ebd4d5f 100644
--- a/crates/gpui/src/platform/mac/window.rs
+++ b/crates/gpui/src/platform/mac/window.rs
@@ -1111,10 +1111,16 @@ impl PlatformWindow for MacWindow {
}
fn update_ime_position(&self, _bounds: Bounds<ScaledPixels>) {
- unsafe {
- let input_context: id = msg_send![class!(NSTextInputContext), currentInputContext];
- let _: () = msg_send![input_context, invalidateCharacterCoordinates];
- }
+ let executor = self.0.lock().executor.clone();
+ executor
+ .spawn(async move {
+ unsafe {
+ let input_context: id =
+ msg_send![class!(NSTextInputContext), currentInputContext];
+ let _: () = msg_send![input_context, invalidateCharacterCoordinates];
+ }
+ })
+ .detach()
}
}