[mutter] seat: Don't save the current stage ourselves



commit 65ed8a817d366fe0c0f6c245db23af0e1e4dbcb5
Author: Jasper St. Pierre <jstpierre mecheye net>
Date:   Thu Apr 17 17:56:56 2014 -0400

    seat: Don't save the current stage ourselves
    
    ClutterInputDevice already saves it.

 src/wayland/meta-wayland-seat.c |   23 ++++++++++-------------
 src/wayland/meta-wayland-seat.h |    2 --
 2 files changed, 10 insertions(+), 15 deletions(-)
---
diff --git a/src/wayland/meta-wayland-seat.c b/src/wayland/meta-wayland-seat.c
index aafbbd6..fba7230 100644
--- a/src/wayland/meta-wayland-seat.c
+++ b/src/wayland/meta-wayland-seat.c
@@ -146,8 +146,6 @@ meta_wayland_seat_new (struct wl_display *display)
 
   seat->display = display;
 
-  seat->current_stage = 0;
-
   wl_global_create (display, &wl_seat_interface, META_WL_SEAT_VERSION, seat, bind_seat);
 
   return seat;
@@ -204,20 +202,19 @@ repick_for_event (MetaWaylandSeat    *seat,
     {
       actor = clutter_event_get_source (for_event);
     }
-  else if (seat->current_stage)
+  else
     {
-      ClutterStage *stage = CLUTTER_STAGE (seat->current_stage);
-      actor = clutter_stage_get_actor_at_pos (stage,
-                                              CLUTTER_PICK_REACTIVE,
-                                              wl_fixed_to_double (pointer->x),
-                                              wl_fixed_to_double (pointer->y));
+      ClutterDeviceManager *device_manager = clutter_device_manager_get_default ();
+      ClutterInputDevice *device = clutter_device_manager_get_device (device_manager, 
META_VIRTUAL_CORE_POINTER_ID);
+      ClutterStage *stage = clutter_input_device_get_pointer_stage (device);
+
+      if (stage)
+        actor = clutter_stage_get_actor_at_pos (stage,
+                                                CLUTTER_PICK_REACTIVE,
+                                                wl_fixed_to_double (pointer->x),
+                                                wl_fixed_to_double (pointer->y));
     }
 
-  if (actor)
-    seat->current_stage = clutter_actor_get_stage (actor);
-  else
-    seat->current_stage = NULL;
-
   if (META_IS_SURFACE_ACTOR_WAYLAND (actor))
     surface = meta_surface_actor_wayland_get_surface (META_SURFACE_ACTOR_WAYLAND (actor));
 
diff --git a/src/wayland/meta-wayland-seat.h b/src/wayland/meta-wayland-seat.h
index 5f807f9..cc3f928 100644
--- a/src/wayland/meta-wayland-seat.h
+++ b/src/wayland/meta-wayland-seat.h
@@ -57,8 +57,6 @@ struct _MetaWaylandSeat
   MetaWaylandKeyboard keyboard;
 
   struct wl_display *display;
-
-  ClutterActor *current_stage;
 };
 
 MetaWaylandSeat *


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