Fix panic in update_ime_position (#21510)
This can call back into the app, so must be done when the platform lock is not held. Release Notes: - Fixes a (rare) panic when changing tab
This commit is contained in:
parent
8f08787cf0
commit
e231321655
1 changed files with 10 additions and 4 deletions
|
@ -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()
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue