wayland/text-input: Ignore text-input state commit when not focused

We might unset focus, or already be out of focus (e.g. an X11 client or
clutter text entry is focused) when a text-input state is committed by
the client. We handled this before, except when text input was
explicitly disabled by the client, the Wayland text-input was in focus
by the input method, and it focused itself out.

Simplify the logic a bit by just dropping the state on the floor in all
cases where after any potential focus changes were done, we are not
focused.

Fixes: https://gitlab.gnome.org/GNOME/mutter/issues/353
This commit is contained in:
Jonas Ådahl 2018-10-23 14:13:33 +02:00
parent 8200995fdb
commit 49fea735aa

View File

@ -503,7 +503,8 @@ text_input_commit_state (struct wl_client *client,
clutter_input_method_focus_out (input_method);
}
}
else if (!clutter_input_focus_is_focused (focus))
if (!clutter_input_focus_is_focused (focus))
return;
if (text_input->pending_state & META_WAYLAND_PENDING_STATE_CONTENT_TYPE)