ime: don’t enable IME if we don’t have keyboard focus

Closes #411
This commit is contained in:
Daniel Eklöf 2021-03-23 14:01:46 +01:00
parent 13b45db13e
commit ed3e70a9c7
No known key found for this signature in database
GPG key ID: 5BBD4992C116573F

12
ime.c
View file

@ -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: weve 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;