From ed3e70a9c78413e85b2cb1c379d26d592c13f827 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Daniel=20Ekl=C3=B6f?= Date: Tue, 23 Mar 2021 14:01:46 +0100 Subject: [PATCH] =?UTF-8?q?ime:=20don=E2=80=99t=20enable=20IME=20if=20we?= =?UTF-8?q?=20don=E2=80=99t=20have=20keyboard=20focus?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Closes #411 --- ime.c | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/ime.c b/ime.c index a224d570..deb6dc9c 100644 --- a/ime.c +++ b/ime.c @@ -385,17 +385,13 @@ ime_enable(struct seat *seat) if (unlikely(seat->wayl->text_input_manager == NULL)) return; - struct terminal *term = seat->kbd_focus; - - /* TODO: we’ve actually seen text-input::enter without first - * seeing keyboard::enter... so perhaps we should check for this, - * and... do what? Ignore IME completely, or do we need to call - * ime_enable() from keyboard::enter too? */ - xassert(term != NULL); - if (!seat->ime.focused) return; + struct terminal *term = seat->kbd_focus; + if (term == NULL) + return; + if (!term->ime_enabled) return;