From 6064a3e020fb3957d0353229ffcfad7b04c4c71a Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Fri, 25 Feb 2022 16:11:54 +0100 Subject: [PATCH] st: Move StEntry away from clutter_event_get_source() Ask the stage about the device actor instead. Since leaving the StEntry also means leaving the contained ClutterText, the checks on LEAVE can be just removed. Part-of: --- src/st/st-entry.c | 12 ++++++++---- 1 file changed, 8 insertions(+), 4 deletions(-) diff --git a/src/st/st-entry.c b/src/st/st-entry.c index 2211185b4..625bbf252 100644 --- a/src/st/st-entry.c +++ b/src/st/st-entry.c @@ -789,7 +789,13 @@ st_entry_enter_event (ClutterActor *actor, ClutterCrossingEvent *event) { StEntryPrivate *priv = ST_ENTRY_PRIV (actor); - if (event->source == priv->entry && event->related != NULL) + ClutterStage *stage; + ClutterActor *target; + + stage = clutter_event_get_stage ((ClutterEvent *) event); + target = clutter_stage_get_event_actor (stage, (ClutterEvent *) event); + + if (target == priv->entry && event->related != NULL) st_entry_set_cursor (ST_ENTRY (actor), TRUE); return CLUTTER_ACTOR_CLASS (st_entry_parent_class)->enter_event (actor, event); @@ -799,9 +805,7 @@ static gboolean st_entry_leave_event (ClutterActor *actor, ClutterCrossingEvent *event) { - StEntryPrivate *priv = ST_ENTRY_PRIV (actor); - if (event->source == priv->entry && event->related != NULL) - st_entry_set_cursor (ST_ENTRY (actor), FALSE); + st_entry_set_cursor (ST_ENTRY (actor), FALSE); return CLUTTER_ACTOR_CLASS (st_entry_parent_class)->leave_event (actor, event); }