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
|
|
@ -788,9 +788,10 @@ pub struct KeyEvent {
|
|||
/// ```
|
||||
pub repeat: bool,
|
||||
|
||||
/// Similar to [`text`][Self::text], except that this is affected by <kbd>Ctrl</kbd>.
|
||||
/// Similar to [`text`][Self::text], except that this is affected by <kbd>Ctrl</kbd> and may
|
||||
/// produce ASCII control characters.
|
||||
///
|
||||
/// For example, pressing <kbd>Ctrl</kbd>+<kbd>a</kbd> produces `Some("\x01")`.
|
||||
/// For example, pressing <kbd>Ctrl</kbd>+<kbd>space</kbd> produces `Some("\x00")`.
|
||||
///
|
||||
/// ## Platform-specific
|
||||
///
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue