diff --git a/clutter/clutter/clutter-input-focus.c b/clutter/clutter/clutter-input-focus.c index 117bab72c..bf4f15ab8 100644 --- a/clutter/clutter/clutter-input-focus.c +++ b/clutter/clutter/clutter-input-focus.c @@ -210,14 +210,6 @@ 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; } diff --git a/clutter/clutter/clutter-text.c b/clutter/clutter/clutter-text.c index 3fab98b4e..a437afbef 100644 --- a/clutter/clutter/clutter-text.c +++ b/clutter/clutter/clutter-text.c @@ -2232,6 +2232,7 @@ clutter_text_press (ClutterActor *actor, return CLUTTER_EVENT_PROPAGATE; clutter_actor_grab_key_focus (actor); + clutter_input_focus_reset (priv->input_focus); clutter_input_focus_set_input_panel_state (priv->input_focus, CLUTTER_INPUT_PANEL_STATE_TOGGLE); diff --git a/src/wayland/meta-wayland-text-input.c b/src/wayland/meta-wayland-text-input.c index f1fdc70c9..17e0b683e 100644 --- a/src/wayland/meta-wayland-text-input.c +++ b/src/wayland/meta-wayland-text-input.c @@ -25,6 +25,7 @@ #include +#include "compositor/meta-surface-actor-wayland.h" #include "wayland/meta-wayland-private.h" #include "wayland/meta-wayland-seat.h" #include "wayland/meta-wayland-versions.h" @@ -788,7 +789,28 @@ meta_wayland_text_input_handle_event (MetaWaylandTextInput *text_input, if (event->type == CLUTTER_BUTTON_PRESS || event->type == CLUTTER_TOUCH_BEGIN) - meta_wayland_text_input_focus_flush_done (text_input->input_focus); + { + MetaWaylandSurface *surface = NULL; + ClutterActor *actor; + + actor = clutter_stage_get_device_actor (clutter_event_get_stage (event), + clutter_event_get_device (event), + clutter_event_get_event_sequence (event)); + + if (META_IS_SURFACE_ACTOR_WAYLAND (actor)) + { + MetaSurfaceActorWayland *actor_wayland = + META_SURFACE_ACTOR_WAYLAND (actor); + + surface = meta_surface_actor_wayland_get_surface (actor_wayland); + + if (surface == text_input->surface) + { + clutter_input_focus_reset (text_input->input_focus); + meta_wayland_text_input_focus_flush_done (text_input->input_focus); + } + } + } return retval; }