Skip to content

Commit

Permalink
wayland: Don't bother to commit preedit text on deactivate (#205)
Browse files Browse the repository at this point in the history
With input-method-unstable-v2, it's impossible to finish preedit texts
before deactivate.

    I think this is a bug in IME. Focus changes deactivates the
    input-method and I think there is no way to know it is going to be
    deactivated in advance. Which means IME does not have chance to
    commit string to old text-input. Also, by the protocol, there is no
    way to distinguish the text-input behind. With these, I think IME
    should reset their internal states (for example, to-be-committed
    string) on deactivate. This is what my wlchewing does, and so it
    does not have this bug.

    @xdavidwu

Reference:
  swaywm/sway#4932 (comment)
  • Loading branch information
simnalamburt authored Feb 5, 2021
1 parent 5eff14d commit 6c38da4
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/frontends/wayland/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -191,13 +191,7 @@ impl KimeContext {
self.grab_kb = Some(kb);
} else if !self.current_state.deactivate && self.pending_state.deactivate {
// Focus lost, reset states
match self.engine.reset() {
'\0' => {}
c => {
self.commit_ch(c);
self.commit();
}
}
self.engine.reset();
if let Some(kb) = self.grab_kb.take() {
kb.release();
}
Expand Down

0 comments on commit 6c38da4

Please sign in to comment.