Send empty Ime::Preedit before the Ime::Commit

This should help downstream to automatically clear it.
This commit is contained in:
Kirill Chibisov
2022-09-11 00:48:24 +03:00
committed by GitHub
parent ba49db2cb9
commit 5d2aca90bd
6 changed files with 47 additions and 22 deletions

View File

@@ -431,6 +431,10 @@ declare_class!(
let is_control = string.chars().next().map_or(false, |c| c.is_control());
if self.is_ime_enabled() && !is_control {
AppState::queue_event(EventWrapper::StaticEvent(Event::WindowEvent {
window_id: self.window_id(),
event: WindowEvent::Ime(Ime::Preedit(String::new(), None)),
}));
AppState::queue_event(EventWrapper::StaticEvent(Event::WindowEvent {
window_id: self.window_id(),
event: WindowEvent::Ime(Ime::Commit(string)),