From 7276aa9f91506a37d5627339e61b7d3c412023cf Mon Sep 17 00:00:00 2001 From: Richard Acayan Date: Fri, 27 Sep 2024 22:05:41 -0400 Subject: [PATCH] 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. --- src/wayland/dispatcher.rs | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/wayland/dispatcher.rs b/src/wayland/dispatcher.rs index 407f1db..6662569 100644 --- a/src/wayland/dispatcher.rs +++ b/src/wayland/dispatcher.rs @@ -68,13 +68,17 @@ 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 + = globals.bind(&queue, 1..=1, ()); - let _: Result - = 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),