From 607287935fb028d836645fccac84a676ed466f08 Mon Sep 17 00:00:00 2001 From: Wez Furlong Date: Sat, 9 Jul 2022 23:12:43 -0700 Subject: [PATCH] wayland: ime: clear compose state after commit refs: #1772 --- window/src/os/wayland/inputhandler.rs | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/window/src/os/wayland/inputhandler.rs b/window/src/os/wayland/inputhandler.rs index 49aea6be9..4dedb3aca 100644 --- a/window/src/os/wayland/inputhandler.rs +++ b/window/src/os/wayland/inputhandler.rs @@ -44,16 +44,18 @@ impl Inner { })); } Event::CommitString { text } => { - conn.dispatch_to_focused_window(match text { - Some(text) => WindowEvent::KeyEvent(KeyEvent { + if let Some(text) = text { + conn.dispatch_to_focused_window(WindowEvent::KeyEvent(KeyEvent { key: KeyCode::composed(&text), modifiers: Modifiers::NONE, repeat_count: 1, key_is_down: true, raw: None, - }), - None => WindowEvent::AdviseDeadKeyStatus(DeadKeyStatus::None), - }); + })); + } + conn.dispatch_to_focused_window(WindowEvent::AdviseDeadKeyStatus( + DeadKeyStatus::None, + )); } Event::Done { serial: _ } => {} _ => {}