[mutter] seat: Rewrite the pointer interface in terms of MetaWaylandPointer
- From: Jasper St. Pierre <jstpierre src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter] seat: Rewrite the pointer interface in terms of MetaWaylandPointer
- Date: Thu, 17 Apr 2014 23:17:06 +0000 (UTC)
commit f3d88ca1d16120b96c4dbc33b14ef26d997015c9
Author: Jasper St. Pierre <jstpierre mecheye net>
Date: Thu Apr 17 17:02:42 2014 -0400
seat: Rewrite the pointer interface in terms of MetaWaylandPointer
src/wayland/meta-wayland-seat.c | 25 +++++++++----------------
1 files changed, 9 insertions(+), 16 deletions(-)
---
diff --git a/src/wayland/meta-wayland-seat.c b/src/wayland/meta-wayland-seat.c
index e345d52..f9b6769 100644
--- a/src/wayland/meta-wayland-seat.c
+++ b/src/wayland/meta-wayland-seat.c
@@ -49,35 +49,28 @@ unbind_resource (struct wl_resource *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,
uint32_t serial,
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)
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]