Skip to content

Commit

Permalink
Fix to work on wlroots>=0.17.1 by changing increasing order of `seria…
Browse files Browse the repository at this point in the history
…l` (#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
  • Loading branch information
xnuk authored Mar 21, 2024
1 parent 33603e0 commit 01ee479
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
1 change: 1 addition & 0 deletions docs/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
3 changes: 1 addition & 2 deletions src/frontends/wayland/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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) {
Expand Down Expand Up @@ -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 {
Expand Down Expand Up @@ -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.");
Expand Down

0 comments on commit 01ee479

Please sign in to comment.