wayland: only bind to input method when enabled

Having multiple input methods at once causes behaviour defined by the
Wayland compositor. In a recent update by Phoc, the most recently
started input method would take priority to demonstrate the instability.

Since the keyboard driver for Wayland can handle a emitting input
without an input method, only try to bind to an input method when it is
enabled.
This commit is contained in:
Richard Acayan 2024-09-27 22:05:41 -04:00
parent 4cd29eec3b
commit 7276aa9f91

View file

@ -68,14 +68,18 @@ impl Dispatcher {
Err(_) => None,
};
let im_man = match globals.bind(&queue, 1..=1, ()) {
Ok(g) => Some(g),
Err(_) => None,
};
let im_man = if cfg.wayland_im_enable() {
let _: Result<zwp_input_method_v1::ZwpInputMethodV1, BindError>
= globals.bind(&queue, 1..=1, ());
match globals.bind(&queue, 1..=1, ()) {
Ok(g) => Some(g),
Err(_) => None,
}
} else {
None
};
let frac_scale_man = match globals.bind(&queue, 1..=1, ()) {
Ok(g) => Some(g),
Err(_) => None,