aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTadeo Kondrak <me@tadeo.ca>2021-01-29 19:57:03 +0000
committerDaniel Eklöf <daniel@ekloef.se>2021-02-12 09:45:43 +0000
commit8a32c5c5c1c1fb5bef33c2e194b3967740a8052f (patch)
tree3df6e598faae9768e2cb0cb1f7d96057fc12bc5e
parentchangelog: add section for 1.6.4 (diff)
ime: Reset terminal's IME state on text_input.leave
To reproduce issue: - Launch an IME from inside foot - Type in some preedit text - Use Ctrl-C to close the IME - IME text stays in terminal until focus is changed
-rw-r--r--CHANGELOG.md7
-rw-r--r--ime.c5
2 files changed, 12 insertions, 0 deletions
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 1376197b..339a9835 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -25,12 +25,19 @@
## 1.6.4
### Added
### Changed
+
+* The IME state no longer stays stuck in the terminal if the IME goes
+ away during preedit.
+
+
### Deprecated
### Removed
### Fixed
### Security
### Contributors
+* [tdeo](https://codeberg.org/tdeo)
+
## 1.6.3
diff --git a/ime.c b/ime.c
index d420fc9f..d851c26f 100644
--- a/ime.c
+++ b/ime.c
@@ -39,6 +39,11 @@ leave(void *data, struct zwp_text_input_v3 *zwp_text_input_v3,
{
struct seat *seat = data;
LOG_DBG("leave: seat=%s", seat->name);
+
+ struct terminal *term = seat->kbd_focus;
+ if (term != NULL)
+ term_ime_reset(term);
+
ime_disable(seat);
}