parent
bf3e882293
commit
5bbba6973f
|
@ -2039,9 +2039,9 @@ checksum = "c811ca4a8c853ef420abd8592ba53ddbbac90410fab6903b3e79972a631f7680"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "winit"
|
name = "winit"
|
||||||
version = "0.27.2"
|
version = "0.27.3"
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
checksum = "83a8f3e9d742401efcfe833b8f84960397482ff049cb7bf59a112e14a4be97f7"
|
checksum = "a22e94ba35ca3ff11820044bfa0dc48b95a3a15569c0068555566a12ef41c9e5"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bitflags",
|
"bitflags",
|
||||||
"cocoa",
|
"cocoa",
|
||||||
|
|
|
@ -419,7 +419,7 @@ impl Ime {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Default)]
|
#[derive(Debug, Default, PartialEq, Eq)]
|
||||||
pub struct Preedit {
|
pub struct Preedit {
|
||||||
/// The preedit text.
|
/// The preedit text.
|
||||||
text: String,
|
text: String,
|
||||||
|
|
|
@ -1236,8 +1236,6 @@ impl input::Processor<EventProxy, ActionContext<'_, Notifier, EventProxy>> {
|
||||||
},
|
},
|
||||||
WindowEvent::Ime(ime) => match ime {
|
WindowEvent::Ime(ime) => match ime {
|
||||||
Ime::Commit(text) => {
|
Ime::Commit(text) => {
|
||||||
// Clear preedit.
|
|
||||||
self.ctx.display.ime.set_preedit(None);
|
|
||||||
*self.ctx.dirty = true;
|
*self.ctx.dirty = true;
|
||||||
|
|
||||||
for ch in text.chars() {
|
for ch in text.chars() {
|
||||||
|
@ -1253,9 +1251,11 @@ impl input::Processor<EventProxy, ActionContext<'_, Notifier, EventProxy>> {
|
||||||
Some(Preedit::new(text, cursor_offset.map(|offset| offset.0)))
|
Some(Preedit::new(text, cursor_offset.map(|offset| offset.0)))
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if self.ctx.display.ime.preedit() != preedit.as_ref() {
|
||||||
self.ctx.display.ime.set_preedit(preedit);
|
self.ctx.display.ime.set_preedit(preedit);
|
||||||
self.ctx.update_cursor_blinking();
|
self.ctx.update_cursor_blinking();
|
||||||
*self.ctx.dirty = true;
|
*self.ctx.dirty = true;
|
||||||
|
}
|
||||||
},
|
},
|
||||||
Ime::Enabled => {
|
Ime::Enabled => {
|
||||||
self.ctx.display.ime.set_enabled(true);
|
self.ctx.display.ime.set_enabled(true);
|
||||||
|
|
Loading…
Reference in New Issue