mirror of
https://github.com/brl/mutter.git
synced 2025-06-14 01:09:30 +00:00
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:

committed by
Marge Bot

parent
ff4953caa6
commit
7716b62fa2
@ -384,7 +384,7 @@ meta_wayland_seat_handle_event (MetaWaylandSeat *seat,
|
||||
break;
|
||||
case CLUTTER_KEY_PRESS:
|
||||
case CLUTTER_KEY_RELEASE:
|
||||
if (meta_wayland_text_input_handle_event (seat->text_input, event))
|
||||
if (meta_wayland_text_input_update (seat->text_input, event))
|
||||
return TRUE;
|
||||
|
||||
if (meta_wayland_seat_has_keyboard (seat))
|
||||
|
@ -800,6 +800,21 @@ meta_wayland_text_input_init (MetaWaylandCompositor *compositor)
|
||||
bind_text_input) != NULL);
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_wayland_text_input_update (MetaWaylandTextInput *text_input,
|
||||
const ClutterEvent *event)
|
||||
{
|
||||
if (!text_input->surface ||
|
||||
!clutter_input_focus_is_focused (text_input->input_focus))
|
||||
return FALSE;
|
||||
|
||||
if (event->type == CLUTTER_KEY_PRESS ||
|
||||
event->type == CLUTTER_KEY_RELEASE)
|
||||
return clutter_input_focus_filter_event (text_input->input_focus, event);
|
||||
|
||||
return FALSE;
|
||||
}
|
||||
|
||||
gboolean
|
||||
meta_wayland_text_input_handle_event (MetaWaylandTextInput *text_input,
|
||||
const ClutterEvent *event)
|
||||
@ -815,7 +830,7 @@ meta_wayland_text_input_handle_event (MetaWaylandTextInput *text_input,
|
||||
clutter_event_get_flags (event) & CLUTTER_EVENT_FLAG_INPUT_METHOD)
|
||||
meta_wayland_text_input_focus_flush_done (text_input->input_focus);
|
||||
|
||||
retval = clutter_input_focus_filter_event (text_input->input_focus, event);
|
||||
retval = clutter_input_focus_process_event (text_input->input_focus, event);
|
||||
|
||||
if (event->type == CLUTTER_BUTTON_PRESS ||
|
||||
event->type == CLUTTER_TOUCH_BEGIN)
|
||||
|
@ -41,6 +41,9 @@ gboolean meta_wayland_text_input_init (MetaWaylandCompositor *compositor);
|
||||
void meta_wayland_text_input_set_focus (MetaWaylandTextInput *text_input,
|
||||
MetaWaylandSurface *surface);
|
||||
|
||||
gboolean meta_wayland_text_input_update (MetaWaylandTextInput *text_input,
|
||||
const ClutterEvent *event);
|
||||
|
||||
gboolean meta_wayland_text_input_handle_event (MetaWaylandTextInput *text_input,
|
||||
const ClutterEvent *event);
|
||||
|
||||
|
Reference in New Issue
Block a user