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.
This commit is contained in:
Rob Bradford 2011-12-08 17:39:15 +00:00
parent 34cc45dae5
commit 320356e97f

View File

@ -145,7 +145,7 @@ clutter_wayland_handle_pointer_focus (void *data,
ClutterStageCogl *stage_cogl; ClutterStageCogl *stage_cogl;
ClutterEvent *event; ClutterEvent *event;
if (device->pointer_focus) if (!surface)
{ {
stage_cogl = device->pointer_focus; 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), _clutter_input_device_set_stage (CLUTTER_INPUT_DEVICE (device),
stage_cogl->wrapper); stage_cogl->wrapper);
event = clutter_event_new (CLUTTER_MOTION); event = clutter_event_new (CLUTTER_ENTER);
event->motion.time = _time; event->crossing.stage = stage_cogl->wrapper;
event->motion.x = sx; event->crossing.time = _time;
event->motion.y = sy; event->crossing.x = sx;
event->motion.modifier_state = device->modifier_state; event->crossing.y = sy;
event->motion.source = CLUTTER_ACTOR (stage_cogl->wrapper); event->crossing.source = CLUTTER_ACTOR (stage_cogl->wrapper);
event->motion.device = CLUTTER_INPUT_DEVICE (device); event->crossing.device = CLUTTER_INPUT_DEVICE (device);
_clutter_event_push (event, FALSE); _clutter_event_push (event, FALSE);