[clutter] wayland: Refine enter/leave event handling



commit 320356e97f2312f8ad4285ca436dca71a69c7cec
Author: Rob Bradford <rob linux intel com>
Date:   Thu Dec 8 17:39:15 2011 +0000

    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 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 431efd5..bb9f942 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);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]