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