From 9c20b4144ac2230724979b17d26362ec06e232b5 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Tue, 27 Jul 2021 16:45:14 +0200 Subject: [PATCH] clutter: Handle touch down and button press events in ClutterInputFocus In line with GTK, the input method context should be reset when clicks are handled by the ClutterInputFocus user. The reset action can then either clear or commit the preedit text, as configured by the IM module. Part-of: --- clutter/clutter/clutter-input-focus.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/clutter/clutter/clutter-input-focus.c b/clutter/clutter/clutter-input-focus.c index 2aea51e24..b54e64aa3 100644 --- a/clutter/clutter/clutter-input-focus.c +++ b/clutter/clutter/clutter-input-focus.c @@ -179,6 +179,14 @@ clutter_input_focus_filter_event (ClutterInputFocus *focus, event->im.offset); return TRUE; } + else if (event->type == CLUTTER_TOUCH_BEGIN || + (event->type == CLUTTER_BUTTON_PRESS && + event->button.button == CLUTTER_BUTTON_PRIMARY)) + { + clutter_input_focus_reset (focus); + /* pointing events are not consumed by IMs */ + return FALSE; + } return FALSE; }