From 3cbfd8351c73d05260d3ac7123f94a2291dd46fe Mon Sep 17 00:00:00 2001 From: Dorota Czaplejewicz Date: Sun, 10 Jan 2021 10:16:07 +0000 Subject: [PATCH 1/2] imservice: Increment serials on receiving done, not sending commit No idea how that managed to stay undetected for so long. --- src/imservice.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/imservice.rs b/src/imservice.rs index 462c4203..e8723e2f 100644 --- a/src/imservice.rs +++ b/src/imservice.rs @@ -149,6 +149,8 @@ pub mod c { ..IMProtocolState::default() }; + imservice.serial += Wrapping(1u32); + if active_changed { (imservice.active_callback)(imservice.current.active); if imservice.current.active { @@ -404,7 +406,6 @@ impl IMService { unsafe { c::eek_input_method_commit(self.im, self.serial.0) } - self.serial += Wrapping(1u32); Ok(()) }, false => Err(SubmitError::NotActive), From 38842f9743e8cf3bfc4962f5241944b2064fade9 Mon Sep 17 00:00:00 2001 From: Dorota Czaplejewicz Date: Sun, 10 Jan 2021 10:45:14 +0000 Subject: [PATCH 2/2] input-method: Fix commit/done mixup in protocol text --- protocols/input-method-unstable-v2.xml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/protocols/input-method-unstable-v2.xml b/protocols/input-method-unstable-v2.xml index 97484d81..a51b98a3 100644 --- a/protocols/input-method-unstable-v2.xml +++ b/protocols/input-method-unstable-v2.xml @@ -294,8 +294,8 @@ 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 commit requests already issued on that object. - When the compositor receives a done event with a serial different than + equal to the number of done events already issued on that object. + When the compositor receives a commit request with a serial different than the number of past commit requests, it must proceed as normal, except it should not change the current state of the zwp_input_method_v2 object.