summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRob Bradford <rob@linux.intel.com>2011-12-08 17:39:15 +0000
committerRob Bradford <rob@linux.intel.com>2011-12-08 17:44:53 +0000
commit320356e97f2312f8ad4285ca436dca71a69c7cec (patch)
tree5c0be857dad83e0bf88ee02ab4b5d46171fb6d2f
parent34cc45dae5f05be80e3eb389c55e40aed2e97bf4 (diff)
downloadclutter-320356e97f2312f8ad4285ca436dca71a69c7cec.tar.gz
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.
-rw-r--r--clutter/wayland/clutter-input-device-wayland.c16
1 files 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);