macOS set_ime_position fixes (#2180)

* Use NSView's inputContext instead of creating our own

This means that `set_ime_position` now properly invalidates the character coordinates.

* Make `set_ime_position` robust against moving windows
This commit is contained in:
Mads Marquart 2022-03-18 14:50:24 +01:00 committed by GitHub
parent a438091266
commit e22c76b3ac
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 19 additions and 35 deletions

View file

@ -147,12 +147,6 @@ pub unsafe fn superclass(this: &Object) -> &Class {
&*superclass
}
pub unsafe fn create_input_context(view: id) -> IdRef {
let input_context: id = msg_send![class!(NSTextInputContext), alloc];
let input_context: id = msg_send![input_context, initWithClient: view];
IdRef::new(input_context)
}
#[allow(dead_code)]
pub unsafe fn open_emoji_picker() {
let () = msg_send![NSApp(), orderFrontCharacterPalette: nil];