From 320356e97f2312f8ad4285ca436dca71a69c7cec Mon Sep 17 00:00:00 2001 From: Rob Bradford Date: Thu, 8 Dec 2011 17:39:15 +0000 Subject: [PATCH] wayland: Refine enter/leave event handling The Wayland protocol now has events represent when a pointer enters the surface and when it leaves again. For leaves the surface is not set in the event, for enters the surface is set. Simply use this to determine whether to emit CLUTTER_ENTER or CLUTTER_LEAVE. --- clutter/wayland/clutter-input-device-wayland.c | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/clutter/wayland/clutter-input-device-wayland.c b/clutter/wayland/clutter-input-device-wayland.c index 431efd5d7..bb9f942eb 100644 --- a/clutter/wayland/clutter-input-device-wayland.c +++ b/clutter/wayland/clutter-input-device-wayland.c @@ -145,7 +145,7 @@ clutter_wayland_handle_pointer_focus (void *data, ClutterStageCogl *stage_cogl; ClutterEvent *event; - if (device->pointer_focus) + if (!surface) { stage_cogl = device->pointer_focus; @@ -171,13 +171,13 @@ clutter_wayland_handle_pointer_focus (void *data, _clutter_input_device_set_stage (CLUTTER_INPUT_DEVICE (device), stage_cogl->wrapper); - event = clutter_event_new (CLUTTER_MOTION); - event->motion.time = _time; - event->motion.x = sx; - event->motion.y = sy; - event->motion.modifier_state = device->modifier_state; - event->motion.source = CLUTTER_ACTOR (stage_cogl->wrapper); - event->motion.device = CLUTTER_INPUT_DEVICE (device); + event = clutter_event_new (CLUTTER_ENTER); + event->crossing.stage = stage_cogl->wrapper; + event->crossing.time = _time; + event->crossing.x = sx; + event->crossing.y = sy; + event->crossing.source = CLUTTER_ACTOR (stage_cogl->wrapper); + event->crossing.device = CLUTTER_INPUT_DEVICE (device); _clutter_event_push (event, FALSE);