From 5ccde659c1c133b01d2028b53486f267e36f0189 Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Tue, 10 May 2016 16:38:48 +0200 Subject: [PATCH] wayland: Add pointer from MetaWaylandTabletSeat to MetaWaylandSeat It will be useful to backreference to the MetaWaylandSeat from tablet code. --- src/wayland/meta-wayland-tablet-manager.c | 2 +- src/wayland/meta-wayland-tablet-seat.c | 4 +++- src/wayland/meta-wayland-tablet-seat.h | 4 +++- 3 files changed, 7 insertions(+), 3 deletions(-) diff --git a/src/wayland/meta-wayland-tablet-manager.c b/src/wayland/meta-wayland-tablet-manager.c index fa1b9069e..b494a4cee 100644 --- a/src/wayland/meta-wayland-tablet-manager.c +++ b/src/wayland/meta-wayland-tablet-manager.c @@ -242,7 +242,7 @@ meta_wayland_tablet_manager_ensure_seat (MetaWaylandTabletManager *manager, if (!tablet_seat) { - tablet_seat = meta_wayland_tablet_seat_new (manager); + tablet_seat = meta_wayland_tablet_seat_new (manager, seat); g_hash_table_insert (manager->seats, seat, tablet_seat); } diff --git a/src/wayland/meta-wayland-tablet-seat.c b/src/wayland/meta-wayland-tablet-seat.c index c6d98fdb2..6366cc35b 100644 --- a/src/wayland/meta-wayland-tablet-seat.c +++ b/src/wayland/meta-wayland-tablet-seat.c @@ -237,13 +237,15 @@ static const struct zwp_tablet_seat_v2_interface tablet_seat_interface = { }; MetaWaylandTabletSeat * -meta_wayland_tablet_seat_new (MetaWaylandTabletManager *manager) +meta_wayland_tablet_seat_new (MetaWaylandTabletManager *manager, + MetaWaylandSeat *seat) { MetaWaylandTabletSeat *tablet_seat; const GSList *devices, *l; tablet_seat = g_slice_new0 (MetaWaylandTabletSeat); tablet_seat->manager = manager; + tablet_seat->seat = seat; tablet_seat->device_manager = clutter_device_manager_get_default (); tablet_seat->tablets = g_hash_table_new_full (NULL, NULL, NULL, (GDestroyNotify) meta_wayland_tablet_free); diff --git a/src/wayland/meta-wayland-tablet-seat.h b/src/wayland/meta-wayland-tablet-seat.h index fc3be0fd6..653f6950d 100644 --- a/src/wayland/meta-wayland-tablet-seat.h +++ b/src/wayland/meta-wayland-tablet-seat.h @@ -31,6 +31,7 @@ struct _MetaWaylandTabletSeat { MetaWaylandTabletManager *manager; + MetaWaylandSeat *seat; ClutterDeviceManager *device_manager; struct wl_list resource_list; @@ -39,7 +40,8 @@ struct _MetaWaylandTabletSeat GHashTable *pads; }; -MetaWaylandTabletSeat *meta_wayland_tablet_seat_new (MetaWaylandTabletManager *tablet_manager); +MetaWaylandTabletSeat *meta_wayland_tablet_seat_new (MetaWaylandTabletManager *tablet_manager, + MetaWaylandSeat *seat); void meta_wayland_tablet_seat_free (MetaWaylandTabletSeat *tablet_seat); struct wl_resource *meta_wayland_tablet_seat_create_new_resource (MetaWaylandTabletSeat *tablet_seat,