Skip to content

Commit

Permalink
Increase serial number at ImEvent::Done, not at commit
Browse files Browse the repository at this point in the history
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
  • Loading branch information
xnuk committed Mar 21, 2024
1 parent 33603e0 commit 5d3d27b
Showing 1 changed file with 1 addition and 2 deletions.
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 5d3d27b

Please sign in to comment.