compositor: Set pointer->current before calling focus handler
authorKristian Høgsberg <krh@bitplanet.net>
Mon, 4 Jun 2012 20:12:38 +0000 (16:12 -0400)
committerKristian Høgsberg <krh@bitplanet.net>
Mon, 4 Jun 2012 20:12:38 +0000 (16:12 -0400)
The grab interface handlers all expect pointer->current to identify
the surface under the pointer regardless of grabs etc.  Thus, we need
to set it before calling the focus handler.

src/compositor.c

index 0168dc9..b3a9d56 100644 (file)
@@ -631,10 +631,10 @@ weston_device_repick(struct wl_seat *seat)
 
        if (&surface->surface != seat->pointer->current) {
                interface = seat->pointer->grab->interface;
+               seat->pointer->current = &surface->surface;
                interface->focus(seat->pointer->grab, &surface->surface,
                                 seat->pointer->current_x,
                                 seat->pointer->current_y);
-               seat->pointer->current = &surface->surface;
        }
 
        focus = (struct weston_surface *) seat->pointer->grab->focus;