examples/ime: fix crash on wayland
When pressing Ctrl+Space, KeyEvent::text_with_all_modifiers would return \0. That would get included in the text-input text. When an input method gets activated, the invalid string returning \0 would get sent as surrounding text, resulting in a Wayland protocol error and crashing the application.
This commit is contained in:
parent
bd6fef1d80
commit
f41897cfa4
2 changed files with 4 additions and 3 deletions
|
|
@ -200,7 +200,7 @@ impl App {
|
|||
self.print_input_state();
|
||||
},
|
||||
_ => {
|
||||
if let Some(text) = event.text_with_all_modifiers {
|
||||
if let Some(text) = event.text {
|
||||
self.input_state.append_text(&text);
|
||||
if self.input_state.ime_enabled {
|
||||
self.window()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue