clutter: Separate ClutterInputFocus event processing and filtering

Currently, we let the same function handle key event filtering as they
are passed to the IM, and the IM events resulting in actions like text
commit or preedit changes.

Split these two aspects into filter/process functions, and port
ClutterText to it. MetaWaylandTextInput still handles everything in
a single place, but that will be split in later commits.

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3044>
This commit is contained in:
Carlos Garnacho
2023-06-01 19:42:22 +02:00
committed by Marge Bot
parent ff4953caa6
commit 7716b62fa2
6 changed files with 42 additions and 4 deletions

View File

@ -190,7 +190,22 @@ clutter_input_focus_filter_event (ClutterInputFocus *focus,
{
return clutter_input_method_filter_key_event (priv->im, &event->key);
}
else if (event->type == CLUTTER_IM_COMMIT)
return FALSE;
}
gboolean
clutter_input_focus_process_event (ClutterInputFocus *focus,
const ClutterEvent *event)
{
ClutterInputFocusPrivate *priv;
g_return_val_if_fail (CLUTTER_IS_INPUT_FOCUS (focus), FALSE);
g_return_val_if_fail (clutter_input_focus_is_focused (focus), FALSE);
priv = clutter_input_focus_get_instance_private (focus);
if (event->type == CLUTTER_IM_COMMIT)
{
clutter_input_focus_commit (focus, event->im.text);
return TRUE;