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
parent 1bc405e526
commit 107bf91a2d
3 changed files with 26 additions and 3 deletions

View File

@@ -226,6 +226,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 {