Skip to content
This repository was archived by the owner on Dec 18, 2021. It is now read-only.

Commit 8ba4d20

Browse files
committed
wayland: Don't bother to commit preedit text on deactivate
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)
1 parent 5eff14d commit 8ba4d20

File tree

1 file changed

+1
-7
lines changed

1 file changed

+1
-7
lines changed

src/frontends/wayland/src/main.rs

+1-7
Original file line numberDiff line numberDiff line change
@@ -191,13 +191,7 @@ impl KimeContext {
191191
self.grab_kb = Some(kb);
192192
} else if !self.current_state.deactivate && self.pending_state.deactivate {
193193
// Focus lost, reset states
194-
match self.engine.reset() {
195-
'\0' => {}
196-
c => {
197-
self.commit_ch(c);
198-
self.commit();
199-
}
200-
}
194+
self.engine.reset();
201195
if let Some(kb) = self.grab_kb.take() {
202196
kb.release();
203197
}

0 commit comments

Comments
 (0)