From 01ee4796910687ff58e3920bfa91d2d110ea9158 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=EC=A6=88=EB=88=85?= Date: Fri, 22 Mar 2024 00:52:47 +0900 Subject: [PATCH] Fix to work on wlroots>=0.17.1 by changing increasing order of `serial` (#664) * 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 * Changelog update --- docs/CHANGELOG.md | 1 + src/frontends/wayland/src/main.rs | 3 +-- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/docs/CHANGELOG.md b/docs/CHANGELOG.md index bd9407e6..36c50b15 100644 --- a/docs/CHANGELOG.md +++ b/docs/CHANGELOG.md @@ -9,6 +9,7 @@ * Add ubuntu-22.10 Dockerfile **[@OctopusET]** * Fix KDE autostart [#576](https://github.com/Riey/kime/issues/576) * Add unicode prime symbols to math mode. (prime, double prime, triple prime, quadruple prime) +* Fix to work on wlroots>=0.17.1 (Sway 1.9) [#664](https://github.com/Riey/kime/issues/664) ## 3.0.2 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.");