Commit 3e472faf authored by Carlos Garnacho's avatar Carlos Garnacho Committed by Carlos Garnacho

wayland: Minor refactor

We use the input_method on both branches, but only check for its existence
when enabling the text_input. The case of focusing out shouldn't happen in
practice as we couldn't have focused in ever before, but still make the
check one level above so it's clearer that the text_input's IM focus cannot
be enabled without an IM implementation.

!432
parent eabb7893
Pipeline #65214 passed with stages
in 4 minutes and 31 seconds
......@@ -472,31 +472,24 @@ text_input_commit_state (struct wl_client *client,
MetaWaylandTextInput *text_input = wl_resource_get_user_data (resource);
ClutterInputFocus *focus = text_input->input_focus;
gboolean enable_panel = FALSE;
ClutterInputMethod *input_method;
increment_serial (text_input, resource);
if (text_input->surface == NULL)
return;
if (text_input->pending_state & META_WAYLAND_PENDING_STATE_ENABLED)
{
ClutterInputMethod *input_method;
input_method = clutter_backend_get_input_method (clutter_get_default_backend ());
input_method = clutter_backend_get_input_method (clutter_get_default_backend ());
if (input_method &&
text_input->pending_state & META_WAYLAND_PENDING_STATE_ENABLED)
{
if (text_input->enabled)
{
if (!clutter_input_focus_is_focused (focus))
{
if (input_method)
clutter_input_method_focus_in (input_method, focus);
else
return;
}
clutter_input_method_focus_in (input_method, focus);
else
{
enable_panel = TRUE;
}
enable_panel = TRUE;
clutter_input_focus_set_can_show_preedit (focus, TRUE);
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment