diff options
| author | Daniel Eklöf <daniel@ekloef.se> | 2021-03-04 08:29:36 +0000 |
|---|---|---|
| committer | Daniel Eklöf <daniel@ekloef.se> | 2021-03-04 08:29:36 +0000 |
| commit | 544cd823d7699d1b5cece3e4fb6faa5ff12c562e (patch) | |
| tree | 03feed8e6e1621ddb2ccd7c42aae27b059770802 | |
| parent | input: mutter has been seen sending NULL surfaces in pointer enter (diff) | |
| parent | ime: don’t commit IME changes when we don’t have IME focus (diff) | |
Merge branch 'ime-dont-commit-unless-we-have-ime-focus'
Closes #384
| -rw-r--r-- | ime.c | 11 | ||||
| -rw-r--r-- | wayland.h | 1 |
2 files changed, 12 insertions, 0 deletions
@@ -26,6 +26,7 @@ enter(void *data, struct zwp_text_input_v3 *zwp_text_input_v3, /* The main grid is the *only* input-receiving surface we have */ xassert(seat->kbd_focus != NULL); + seat->ime.focused = true; ime_enable(seat); } @@ -41,6 +42,7 @@ leave(void *data, struct zwp_text_input_v3 *zwp_text_input_v3, term_ime_reset(term); ime_disable(seat); + seat->ime.focused = false; } static void @@ -334,6 +336,9 @@ ime_send_cursor_rect(struct seat *seat, struct terminal *term) if (unlikely(seat->wayl->text_input_manager == NULL)) return; + if (!seat->ime.focused) + return; + if (!term->ime.enabled) return; @@ -367,6 +372,9 @@ ime_enable(struct seat *seat) struct terminal *term = seat->kbd_focus; xassert(term != NULL); + if (!seat->ime.focused) + return; + if (!term->ime.enabled) return; @@ -397,6 +405,9 @@ ime_disable(struct seat *seat) if (unlikely(seat->wayl->text_input_manager == NULL)) return; + if (!seat->ime.focused) + return; + ime_reset(seat); zwp_text_input_v3_disable(seat->wl_text_input); @@ -271,6 +271,7 @@ struct seat { } pending; } surrounding; + bool focused; uint32_t serial; } ime; #endif |
