From 18b702b2495d4fb9328930eed9875731cff4cbde Mon Sep 17 00:00:00 2001 From: Daniel Eklöf Date: Tue, 21 May 2024 07:06:45 +0200 Subject: unicode-mode: move state from seat to term This fixes an issue where entering unicode-mode in one foot client, also enabled unicode-mode on other foot clients. Both visually (although glitchy), and in effect. The reason the state was originally in the seat objects, was to fully support multi-seat. That is, one seat/keyboard entering unicode-mode should not affect other seats/keyboards. The issue with this is that seat objects are Wayland global. Thus, in server mode, all seat objects are shared between the foot clients. There is a similarity with IME, which also keeps state in the seat. There's one big difference, however, and that is IME has Wayland native enter/leave events, that the compositor emits when windows are focused/unfocused. These events allow us to reset IME state. For our own Unicode mode, there is nothing similar. This patch moves the Unicode state from seats, to the terminal struct. This does mean that if one seat/keyboard enters Unicode mode, then *all* seats/keyboards will affect the unicode state. This potential downside is outweighed by the fact that different foot clients no longer affect each other. Closes #1717 --- input.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'input.c') diff --git a/input.c b/input.c index 26f62629..33b5446c 100644 --- a/input.c +++ b/input.c @@ -441,7 +441,7 @@ execute_binding(struct seat *seat, struct terminal *term, } case BIND_ACTION_UNICODE_INPUT: - unicode_mode_activate(seat); + unicode_mode_activate(term); return true; case BIND_ACTION_QUIT: @@ -1550,7 +1550,7 @@ key_press_release(struct seat *seat, struct terminal *term, uint32_t serial, xassert(bindings != NULL); if (pressed) { - if (seat->unicode_mode.active) { + if (term->unicode_mode.active) { unicode_mode_input(seat, term, sym); return; } -- cgit v1.3