x11: fix crash with uim

Let's just not forward events to the IME once the user requested that
it should be disabled, though, still try to change its state explicitly.

Fixes #4082.
This commit is contained in:
Kirill Chibisov 2025-02-03 20:43:43 +03:00 committed by GitHub
parent 5c48ec7977
commit a6998af997
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 22 additions and 37 deletions

View file

@ -82,9 +82,7 @@ impl InputMethod {
}
let preedit_style = preedit_style.unwrap_or_else(|| none_style.unwrap());
// Always initialize none style even when it's not advertised, since it seems to work
// regardless...
let none_style = none_style.unwrap_or(Style::None(XIM_NONE_STYLE));
let none_style = none_style.unwrap_or(preedit_style);
Some(InputMethod { im, _name: name, preedit_style, none_style })
}