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
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 47 additions and 22 deletions

View file

@ -621,6 +621,12 @@ impl<T: 'static> EventProcessor<T> {
// If we're composing right now, send the string we've got from X11 via
// Ime::Commit.
if self.is_composing && keycode == 0 && !written.is_empty() {
let event = Event::WindowEvent {
window_id,
event: WindowEvent::Ime(Ime::Preedit(String::new(), None)),
};
callback(event);
let event = Event::WindowEvent {
window_id,
event: WindowEvent::Ime(Ime::Commit(written)),