From 3e554efc706bd28e3154bba3599b4db4dc861436 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Fri, 18 Apr 2014 18:46:15 -0400 Subject: [PATCH] pointer: Clean up repick_for_event a bit --- src/wayland/meta-wayland-pointer.c | 22 +++++++++------------- 1 file changed, 9 insertions(+), 13 deletions(-) diff --git a/src/wayland/meta-wayland-pointer.c b/src/wayland/meta-wayland-pointer.c index f19e52a70..de464086d 100644 --- a/src/wayland/meta-wayland-pointer.c +++ b/src/wayland/meta-wayland-pointer.c @@ -356,9 +356,8 @@ static void repick_for_event (MetaWaylandPointer *pointer, const ClutterEvent *for_event) { - ClutterActor *actor = NULL; - MetaWaylandSurface *surface = NULL; - MetaDisplay *display = meta_get_display (); + ClutterActor *actor = NULL; + MetaDisplay *display = meta_get_display (); if (for_event) { @@ -378,21 +377,18 @@ repick_for_event (MetaWaylandPointer *pointer, } } - if (META_IS_SURFACE_ACTOR_WAYLAND (actor)) - surface = meta_surface_actor_wayland_get_surface (META_SURFACE_ACTOR_WAYLAND (actor)); + if (META_IS_SURFACE_ACTOR_WAYLAND (actor) && !meta_grab_op_should_block_wayland (display->grab_op)) + pointer->current = meta_surface_actor_wayland_get_surface (META_SURFACE_ACTOR_WAYLAND (actor)); + else + pointer->current = NULL; - if (meta_grab_op_should_block_wayland (display->grab_op)) - surface = NULL; - - pointer->current = surface; - - if (pointer->cursor_tracker && surface == NULL) + if (pointer->cursor_tracker && pointer->current == NULL) meta_cursor_tracker_unset_window_cursor (pointer->cursor_tracker); - if (surface != pointer->focus_surface) + if (pointer->current != pointer->focus_surface) { const MetaWaylandPointerGrabInterface *interface = pointer->grab->interface; - interface->focus (pointer->grab, surface); + interface->focus (pointer->grab, pointer->current); } }