wayland: Avoid clutter_input_focus method calls when unfocused

If text_input_enable() is called when there no active IM (eg. running plain
mutter), some ClutterInputFocus method calls that are not allowed while
unfocused will end up called, triggering critical warnings.

If there is no IM return early here, all other calls are superfluous then.
This commit is contained in:
Carlos Garnacho 2018-02-11 22:04:30 +01:00
parent 37aab9280a
commit 6934b83f44

View File

@ -301,6 +301,8 @@ text_input_enable (struct wl_client *client,
input_method = clutter_backend_get_input_method (clutter_get_default_backend ());
if (input_method)
clutter_input_method_focus_in (input_method, focus);
else
return;
}
show_preedit = (flags & GTK_TEXT_INPUT_ENABLE_FLAGS_CAN_SHOW_PREEDIT) != 0;