ime: add functions to enable/disable IME, simplify code that enables IME

We may want to be able to enable/disable IME run-time, even though we
have received an ‘enter’ IME event.

This enables us to do that.

Also add functions to enable/disable IME on a per-terminal instance
basis.

A terminal may have multiple seats focusing it, and enabling/disabling
IME in a terminal instance enables/disables IME on all those seats.

Finally, the code to enable IME is simplified; the *only* surface that
can ever receive ‘enter’ IME events is the main grid. All other
surfaces are sub-surfaces, without their own keyboard focus.
This commit is contained in:
Daniel Eklöf 2020-12-04 18:39:11 +01:00
parent 5c17b7f8e7
commit b59d695b2b
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F
5 changed files with 122 additions and 48 deletions

View file

@ -126,6 +126,9 @@ extract_finish(struct extraction_context *context, char **text, size_t *len)
void cmd_scrollback_up(struct terminal *term, int rows) {}
void cmd_scrollback_down(struct terminal *term, int rows) {}
void ime_enable(struct seat *seat) {}
void ime_disable(struct seat *seat) {}
int
main(int argc, const char *const *argv)
{