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

clutter: Make ClutterInputFocus API to set panel state explicit

Before we just had API to toggle the OSK panel state. Make this API
generic so the upper layers may set the state as they see fit.
All callers have been updated.

!432
parent 033a771e
......@@ -175,7 +175,8 @@ clutter_input_focus_set_can_show_preedit (ClutterInputFocus *focus,
}
void
clutter_input_focus_request_toggle_input_panel (ClutterInputFocus *focus)
clutter_input_focus_set_input_panel_state (ClutterInputFocus *focus,
ClutterInputPanelState state)
{
ClutterInputFocusPrivate *priv;
......@@ -184,7 +185,7 @@ clutter_input_focus_request_toggle_input_panel (ClutterInputFocus *focus)
priv = clutter_input_focus_get_instance_private (focus);
clutter_input_method_toggle_input_panel (priv->im);
clutter_input_method_set_input_panel_state (priv->im, state);
}
void
......
......@@ -78,6 +78,7 @@ CLUTTER_EXPORT
void clutter_input_focus_set_can_show_preedit (ClutterInputFocus *focus,
gboolean can_show_preedit);
CLUTTER_EXPORT
void clutter_input_focus_request_toggle_input_panel (ClutterInputFocus *focus);
void clutter_input_focus_set_input_panel_state (ClutterInputFocus *focus,
ClutterInputPanelState state);
#endif /* __CLUTTER_INPUT_FOCUS_H__ */
......@@ -363,12 +363,12 @@ clutter_input_method_notify_key_event (ClutterInputMethod *im,
}
void
clutter_input_method_toggle_input_panel (ClutterInputMethod *im)
clutter_input_method_set_input_panel_state (ClutterInputMethod *im,
ClutterInputPanelState state)
{
g_return_if_fail (CLUTTER_IS_INPUT_METHOD (im));
g_signal_emit (im, signals[INPUT_PANEL_STATE], 0,
CLUTTER_INPUT_PANEL_STATE_TOGGLE);
g_signal_emit (im, signals[INPUT_PANEL_STATE], 0, state);
}
void
......
......@@ -83,7 +83,8 @@ void clutter_input_method_notify_key_event (ClutterInputMethod *im,
const ClutterEvent *event,
gboolean filtered);
CLUTTER_EXPORT
void clutter_input_method_request_toggle_input_panel (ClutterInputMethod *im);
void clutter_input_method_set_input_panel_state (ClutterInputMethod *im,
ClutterInputPanelState state);
CLUTTER_EXPORT
void clutter_input_method_forward_key (ClutterInputMethod *im,
......
......@@ -2186,7 +2186,8 @@ clutter_text_press (ClutterActor *actor,
return CLUTTER_EVENT_PROPAGATE;
clutter_actor_grab_key_focus (actor);
clutter_input_focus_request_toggle_input_panel (priv->input_focus);
clutter_input_focus_set_input_panel_state (priv->input_focus,
CLUTTER_INPUT_PANEL_STATE_TOGGLE);
/* if the actor is empty we just reset everything and not
* set up the dragging of the selection since there's nothing
......
......@@ -309,7 +309,7 @@ text_input_enable (struct wl_client *client,
clutter_input_focus_set_can_show_preedit (focus, show_preedit);
if (flags & GTK_TEXT_INPUT_ENABLE_FLAGS_TOGGLE_INPUT_PANEL)
clutter_input_focus_request_toggle_input_panel (focus);
clutter_input_focus_set_input_panel_state (focus, CLUTTER_INPUT_PANEL_STATE_TOGGLE);
}
static void
......
......@@ -549,7 +549,7 @@ text_input_commit_state (struct wl_client *client,
meta_wayland_text_input_reset (text_input);
if (toggle_panel)
clutter_input_focus_request_toggle_input_panel (focus);
clutter_input_focus_set_input_panel_state (focus, CLUTTER_INPUT_PANEL_STATE_TOGGLE);
}
static struct zwp_text_input_v3_interface meta_text_input_interface = {
......
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