wayland: Add pointer from MetaWaylandTabletSeat to MetaWaylandSeat

It will be useful to backreference to the MetaWaylandSeat from tablet
code.
This commit is contained in:
Carlos Garnacho 2016-05-10 16:38:48 +02:00
parent fd62a1f6ce
commit 5ccde659c1
3 changed files with 7 additions and 3 deletions

View File

@ -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);
}

View File

@ -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);

View File

@ -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,