On X11, fix IME not working

The change to xinput2 completely disabled IME support, thus we've got
a dead keys reporting, because nothing was eating the key events
anymore, however that's not what we really need, given that not
working IME makes it impossible for some users to type.

The proper solution is to not use Xlib at all for that and rely on
xcb and its tooling around the XIM and text compose stuff, so
we'll have full control over what is getting sent to the XIM/IC or not.

Fixes #2888.
This commit is contained in:
Kirill Chibisov 2023-06-30 19:59:24 +04:00 committed by GitHub
parent b0106898f7
commit a320702a71
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
4 changed files with 57 additions and 59 deletions

View file

@ -188,6 +188,15 @@ impl<T: 'static> EventLoop<T> {
panic!("X server missing XKB extension");
}
// Enable detectable auto repeat.
let mut supported = 0;
unsafe {
(xconn.xlib.XkbSetDetectableAutoRepeat)(xconn.display, 1, &mut supported);
}
if supported == 0 {
warn!("Detectable auto repeart is not supported");
}
ext
};
@ -283,6 +292,7 @@ impl<T: 'static> EventLoop<T> {
first_touch: None,
active_window: None,
is_composing: false,
got_key_release: true,
};
// Register for device hotplug events