diff --git a/clutter/clutter/clutter-event.c b/clutter/clutter/clutter-event.c index 6d2c19ff2..667fe8c96 100644 --- a/clutter/clutter/clutter-event.c +++ b/clutter/clutter/clutter-event.c @@ -509,6 +509,10 @@ clutter_event_get_source (const ClutterEvent *event) { g_return_val_if_fail (event != NULL, NULL); + if (event->type == CLUTTER_ENTER || + event->type == CLUTTER_LEAVE) + return event->crossing.source; + return clutter_stage_get_event_actor (clutter_event_get_stage (event), event); } diff --git a/clutter/clutter/clutter-event.h b/clutter/clutter/clutter-event.h index 1220ef21d..132f96820 100644 --- a/clutter/clutter/clutter-event.h +++ b/clutter/clutter/clutter-event.h @@ -242,6 +242,7 @@ struct _ClutterCrossingEvent gfloat y; ClutterInputDevice *device; ClutterEventSequence *sequence; + ClutterActor *source; ClutterActor *related; }; diff --git a/clutter/clutter/clutter-stage.c b/clutter/clutter/clutter-stage.c index 714883d3a..56919c827 100644 --- a/clutter/clutter/clutter-stage.c +++ b/clutter/clutter/clutter-stage.c @@ -3400,6 +3400,7 @@ create_crossing_event (ClutterStage *stage, event->crossing.stage = stage; event->crossing.x = coords.x; event->crossing.y = coords.y; + event->crossing.source = source; event->crossing.related = related; event->crossing.sequence = sequence; clutter_event_set_device (event, device);