From 65ed8a817d366fe0c0f6c245db23af0e1e4dbcb5 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 17 Apr 2014 17:56:56 -0400 Subject: [PATCH] seat: Don't save the current stage ourselves ClutterInputDevice already saves it. --- src/wayland/meta-wayland-seat.c | 25 +++++++++++-------------- src/wayland/meta-wayland-seat.h | 2 -- 2 files changed, 11 insertions(+), 16 deletions(-) diff --git a/src/wayland/meta-wayland-seat.c b/src/wayland/meta-wayland-seat.c index aafbbd661..fba7230f7 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,19 +202,18 @@ repick_for_event (MetaWaylandSeat *seat, { actor = clutter_event_get_source (for_event); } - else if (seat->current_stage) - { - 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)); - } - - if (actor) - seat->current_stage = clutter_actor_get_stage (actor); else - seat->current_stage = NULL; + { + 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 (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 5f807f9b5..cc3f92843 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 *