From 36c61894056d5a97317dea45e74266a5ca08b1a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=98yvind=20Kol=C3=A5s?= Date: Thu, 15 Nov 2007 17:32:09 +0000 Subject: [PATCH] * clutter/clutter-main.c: (generate_enter_leave_events), (clutter_do_event): moved the generation of enter/leave events to a utility function. --- clutter/clutter-main.c | 43 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) diff --git a/clutter/clutter-main.c b/clutter/clutter-main.c index ff876f302..17501c93b 100644 --- a/clutter/clutter-main.c +++ b/clutter/clutter-main.c @@ -1203,6 +1203,48 @@ done: #undef MAX_EVENT_DEPTH } +<<<<<<< .mine + +static inline void generate_enter_leave_events (ClutterMainContext *context, + ClutterActor *motion_current_actor, + ClutterEvent *event) +{ + static ClutterActor *motion_last_actor = NULL; + + if (motion_last_actor != motion_current_actor) + { + if (motion_last_actor && motion_current_actor) + { + ClutterEvent cev; + + cev.crossing.type = CLUTTER_LEAVE; + cev.crossing.time = event->any.time; + cev.crossing.flags = 0; + cev.crossing.x = event->motion.x; + cev.crossing.y = event->motion.y; + cev.crossing.source = motion_last_actor; + /* unref in free */ + cev.crossing.related = g_object_ref (motion_current_actor); + + g_queue_push_head (context->events_queue, + clutter_event_copy (&cev)); + + cev.crossing.type = CLUTTER_ENTER; + cev.crossing.time = event->any.time; + cev.crossing.flags = 0; + cev.crossing.x = event->motion.x; + cev.crossing.y = event->motion.y; + cev.crossing.source = motion_current_actor; + cev.crossing.related = g_object_ref (motion_last_actor); + + g_queue_push_head (context->events_queue, + clutter_event_copy (&cev)); + } + } + motion_last_actor = motion_current_actor; +} + +======= static void generate_enter_leave_events (ClutterMainContext *context, ClutterActor *motion_current_actor, @@ -1243,6 +1285,7 @@ static void generate_enter_leave_events (ClutterMainContext *context, motion_last_actor = motion_current_actor; } +>>>>>>> .r1604 /** * clutter_do_event * @event: a #ClutterEvent.