From e8ffb05bc7fb3b996752f345b77af4b757f69776 Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Tue, 23 Mar 2021 13:03:07 +0100 Subject: ime: move preedit state from terminal struct to the seat struct MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit This ensures different seat’s don’t step on each others IME pre-edit state. It also removes most dependencies on having a valid term pointer for many IME operations. We’re still not all the way, since we support disabling IME with a private mode, which is per terminal, not seat. Thus, we still require the seat to have keyboard focus on one of our windows. Closes #324. But note that *rendering* of multiple seat’s IME pre-edit strings is still broken. --- terminal.h | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-) (limited to 'terminal.h') diff --git a/terminal.h b/terminal.h index 6cf52522..ce808ce8 100644 --- a/terminal.h +++ b/terminal.h @@ -567,20 +567,7 @@ struct terminal { struct grid *url_grid_snapshot; #if defined(FOOT_IME_ENABLED) && FOOT_IME_ENABLED - struct { - bool enabled; - struct { - wchar_t *text; - struct cell *cells; - int count; - - struct { - bool hidden; - int start; /* Cell index, inclusive */ - int end; /* Cell index, exclusive */ - } cursor; - } preedit; - } ime; + bool ime_enabled; #endif bool is_shutting_down; @@ -713,7 +700,7 @@ bool term_view_to_text( bool term_ime_is_enabled(const struct terminal *term); void term_ime_enable(struct terminal *term); void term_ime_disable(struct terminal *term); -void term_ime_reset(struct terminal *term); +bool term_ime_reset(struct terminal *term); void term_ime_set_cursor_rect( struct terminal *term, int x, int y, int width, int height); -- cgit v1.3