Send empty Ime::Preedit before the Ime::Commit
This should help downstream to automatically clear it.
This commit is contained in:
parent
ba49db2cb9
commit
5d2aca90bd
6 changed files with 47 additions and 22 deletions
|
|
@ -1262,6 +1262,10 @@ unsafe fn public_window_callback_inner<T: 'static>(
|
|||
if let Some(text) = ime_context.get_composed_text() {
|
||||
userdata.window_state_lock().ime_state = ImeState::Enabled;
|
||||
|
||||
userdata.send_event(Event::WindowEvent {
|
||||
window_id: RootWindowId(WindowId(window)),
|
||||
event: WindowEvent::Ime(Ime::Preedit(String::new(), None)),
|
||||
});
|
||||
userdata.send_event(Event::WindowEvent {
|
||||
window_id: RootWindowId(WindowId(window)),
|
||||
event: WindowEvent::Ime(Ime::Commit(text)),
|
||||
|
|
@ -1298,6 +1302,10 @@ unsafe fn public_window_callback_inner<T: 'static>(
|
|||
// trying receiving composing result and commit if exists.
|
||||
let ime_context = ImeContext::current(window);
|
||||
if let Some(text) = ime_context.get_composed_text() {
|
||||
userdata.send_event(Event::WindowEvent {
|
||||
window_id: RootWindowId(WindowId(window)),
|
||||
event: WindowEvent::Ime(Ime::Preedit(String::new(), None)),
|
||||
});
|
||||
userdata.send_event(Event::WindowEvent {
|
||||
window_id: RootWindowId(WindowId(window)),
|
||||
event: WindowEvent::Ime(Ime::Commit(text)),
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue