1
1
mirror of https://github.com/wez/wezterm.git synced 2024-09-19 02:37:51 +03:00

x11: synthesize clearing dead key status when composing via IME

We have two different ways to compose:

* Via xkbd
* Via IME messages

In the latter case, we receive notifications from the IME about
the composed text, but are apparently not guaranteed to receive
them about the composition status overall.

This commit will synthesize clearing the composition status
when we receive the instruction to emit composed text.

The hope is that this will clear the compose cursor state
that appears to get stuck for some users of ibus + Gnome 45.

refs: https://github.com/wez/wezterm/issues/4841
This commit is contained in:
Wez Furlong 2024-01-23 10:25:52 -07:00
parent 463c457528
commit 851997cce4
No known key found for this signature in database
GPG Key ID: 7A7F66A31EC9B387

View File

@ -679,6 +679,11 @@ impl XWindowInner {
.normalize_shift()
.resurface_positional_modifier_key();
self.events.dispatch(WindowEvent::KeyEvent(key_event));
// Since we just composed, synthesize a cleared status, as we
// are not guaranteed to receive an event notification to
// trigger dispatch_ime_compose_status() above.
// <https://github.com/wez/wezterm/issues/4841>
self.events.dispatch(WindowEvent::AdviseDeadKeyStatus(DeadKeyStatus::None));
}
/// If we own the selection, make sure that the X server reflects