From f3d88ca1d16120b96c4dbc33b14ef26d997015c9 Mon Sep 17 00:00:00 2001 From: "Jasper St. Pierre" Date: Thu, 17 Apr 2014 17:02:42 -0400 Subject: [PATCH] seat: Rewrite the pointer interface in terms of MetaWaylandPointer --- src/wayland/meta-wayland-seat.c | 25 +++++++++---------------- 1 file changed, 9 insertions(+), 16 deletions(-) diff --git a/src/wayland/meta-wayland-seat.c b/src/wayland/meta-wayland-seat.c index e345d5208..f9b6769d4 100644 --- a/src/wayland/meta-wayland-seat.c +++ b/src/wayland/meta-wayland-seat.c @@ -48,13 +48,6 @@ unbind_resource (struct wl_resource *resource) wl_list_remove (wl_resource_get_link (resource)); } -static void -set_cursor_surface (MetaWaylandSeat *seat, - MetaWaylandSurface *surface) -{ - meta_wayland_pointer_set_cursor_surface (&seat->pointer, surface); -} - static void pointer_set_cursor (struct wl_client *client, struct wl_resource *resource, @@ -62,22 +55,22 @@ pointer_set_cursor (struct wl_client *client, struct wl_resource *surface_resource, int32_t x, int32_t y) { - MetaWaylandSeat *seat = wl_resource_get_user_data (resource); + MetaWaylandPointer *pointer = wl_resource_get_user_data (resource); MetaWaylandSurface *surface; surface = (surface_resource ? wl_resource_get_user_data (surface_resource) : NULL); - if (seat->pointer.focus_surface == NULL) + if (pointer->focus_surface == NULL) return; - if (wl_resource_get_client (seat->pointer.focus_surface->resource) != client) + if (wl_resource_get_client (pointer->focus_surface->resource) != client) return; - if (seat->pointer.focus_serial - serial > G_MAXUINT32 / 2) + if (pointer->focus_serial - serial > G_MAXUINT32 / 2) return; - seat->pointer.hotspot_x = x; - seat->pointer.hotspot_y = y; - set_cursor_surface (seat, surface); - meta_wayland_pointer_update_cursor_surface (&seat->pointer); + pointer->hotspot_x = x; + pointer->hotspot_y = y; + meta_wayland_pointer_set_cursor_surface (pointer, surface); + meta_wayland_pointer_update_cursor_surface (pointer); } static void @@ -103,7 +96,7 @@ seat_get_pointer (struct wl_client *client, cr = wl_resource_create (client, &wl_pointer_interface, MIN (META_WL_POINTER_VERSION, wl_resource_get_version (resource)), id); - wl_resource_set_implementation (cr, &pointer_interface, seat, unbind_resource); + wl_resource_set_implementation (cr, &pointer_interface, pointer, unbind_resource); wl_list_insert (&pointer->resource_list, wl_resource_get_link (cr)); if (pointer->focus_surface && wl_resource_get_client (pointer->focus_surface->resource) == client)