x11: don't forward key events to IME when it's disabled

Fixes #3815.
This commit is contained in:
Kirill Chibisov 2024-10-13 21:57:02 +03:00 committed by GitHub
parent 8fe2b62adf
commit c23bed20b8
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 25 additions and 3 deletions

View file

@ -225,6 +225,16 @@ impl Ime {
// Create new context supporting IME input.
let _ = self.create_context(window, allowed);
}
pub fn is_ime_allowed(&self, window: ffi::Window) -> bool {
if self.is_destroyed() {
false
} else if let Some(Some(context)) = self.inner.contexts.get(&window) {
context.is_allowed()
} else {
false
}
}
}
impl Drop for Ime {