wayland: Use ClutterEvent getter methods

Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/3153>
This commit is contained in:
Carlos Garnacho
2023-08-04 12:33:33 +02:00
parent 71fb87a9f2
commit 64490c3489
16 changed files with 170 additions and 100 deletions

View File

@ -814,12 +814,16 @@ gboolean
meta_wayland_text_input_update (MetaWaylandTextInput *text_input,
const ClutterEvent *event)
{
ClutterEventType event_type;
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)
event_type = clutter_event_type (event);
if (event_type == CLUTTER_KEY_PRESS ||
event_type == CLUTTER_KEY_RELEASE)
return clutter_input_focus_filter_event (text_input->input_focus, event);
return FALSE;
@ -829,21 +833,24 @@ gboolean
meta_wayland_text_input_handle_event (MetaWaylandTextInput *text_input,
const ClutterEvent *event)
{
ClutterEventType event_type;
gboolean retval;
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) &&
event_type = clutter_event_type (event);
if ((event_type == CLUTTER_KEY_PRESS ||
event_type == CLUTTER_KEY_RELEASE) &&
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_process_event (text_input->input_focus, event);
if (event->type == CLUTTER_BUTTON_PRESS ||
event->type == CLUTTER_TOUCH_BEGIN)
if (event_type == CLUTTER_BUTTON_PRESS ||
event_type == CLUTTER_TOUCH_BEGIN)
{
MetaWaylandSurface *surface = NULL;
MetaBackend *backend;