summaryrefslogtreecommitdiff
path: root/clutter/clutter/clutter-text.c
diff options
context:
space:
mode:
authorCarlos Garnacho <carlosg@gnome.org>2018-03-13 12:00:47 +0100
committerCarlos Garnacho <carlosg@gnome.org>2018-03-13 12:15:38 +0100
commit02b99f45ca78f7f77d35e1a6ff639414d07ff52f (patch)
tree28871ce8199c4f948fd61bf4e14984375fa1f462 /clutter/clutter/clutter-text.c
parent47856d97011d7a9bd13c1e1c638a6e43ebd9d9ac (diff)
downloadmutter-wip/carlosg/fix-issue-65.tar.gz
clutter: Give the ClutterTextInputFocus a first stab at handling key eventswip/carlosg/fix-issue-65
Actor keybindings were dispatched in an earlier return path, which means the IM doesn't get to see certain key events. Flip the order around so the IM has an opportunity to handle all keypresses. https://gitlab.gnome.org/GNOME/mutter/issues/65 Closes: #65
Diffstat (limited to 'clutter/clutter/clutter-text.c')
-rw-r--r--clutter/clutter/clutter-text.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/clutter/clutter/clutter-text.c b/clutter/clutter/clutter-text.c
index 280df0340..4828a4cbd 100644
--- a/clutter/clutter/clutter-text.c
+++ b/clutter/clutter/clutter-text.c
@@ -2224,6 +2224,11 @@ clutter_text_key_press (ClutterActor *actor,
pool = clutter_binding_pool_find (g_type_name (CLUTTER_TYPE_TEXT));
g_assert (pool != NULL);
+ if (!(event->flags & CLUTTER_EVENT_FLAG_INPUT_METHOD) &&
+ clutter_input_focus_is_focused (priv->input_focus) &&
+ clutter_input_focus_filter_key_event (priv->input_focus, event))
+ return CLUTTER_EVENT_STOP;
+
/* we allow passing synthetic events that only contain
* the Unicode value and not the key symbol, unless they
* contain the input method flag.
@@ -2247,10 +2252,6 @@ clutter_text_key_press (ClutterActor *actor,
{
gunichar key_unichar;
- if (clutter_input_focus_is_focused (priv->input_focus) &&
- clutter_input_focus_filter_key_event (priv->input_focus, event))
- return CLUTTER_EVENT_STOP;
-
/* Skip keys when control is pressed */
key_unichar = clutter_event_get_key_unicode ((ClutterEvent *) event);