mirror of
https://github.com/rust-windowing/winit.git
synced 2026-08-29 12:50:04 -04:00
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:
@@ -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()
|
||||
|
||||
Reference in New Issue
Block a user