From 5d3d27b8087528707a1d7c8fb3607fb0515c774b Mon Sep 17 00:00:00 2001 From: Xnuk Shuman Date: Thu, 21 Mar 2024 22:54:11 +0900 Subject: [PATCH] Increase serial number at `ImEvent::Done`, not at commit Fixes #663 > The serial number reflects the last state of the zwp_input_method_v2 object known to the client. The value of the serial argument must be equal to the **number of done events** already issued by that object. When the compositor receives a commit request with a serial different than the number of past done events, it must proceed as normal, except it should not change the current state of the zwp_input_method_v2 object. https://wayland.app/protocols/input-method-unstable-v2#zwp_input_method_v2:request:commit --- src/frontends/wayland/src/main.rs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/src/frontends/wayland/src/main.rs b/src/frontends/wayland/src/main.rs index 3de3fd56..18a7ee8c 100644 --- a/src/frontends/wayland/src/main.rs +++ b/src/frontends/wayland/src/main.rs @@ -177,7 +177,6 @@ impl KimeContext { fn commit(&mut self) { self.im.commit(self.serial); - self.serial += 1; } fn commit_string(&mut self, s: String) { @@ -208,6 +207,7 @@ impl KimeContext { panic!("Unavailable") } ImEvent::Done => { + self.serial += 1; if !self.current_state.activate && self.pending_state.activate { self.engine.update_layout_state(); if !self.engine_ready { @@ -379,7 +379,6 @@ impl KimeContext { key, state: KeyState::Pressed, }; - self.serial += 1; self.handle_key_ev(ev); } else { log::warn!("Received timer event when it has never received RepeatInfo.");