[mutter/wip/tablet-protocol-v2: 6/8] wayland: Add pointer from MetaWaylandTabletSeat to MetaWaylandSeat



commit 712139bfaff31caefd94e36b4c7e1719dd66cfd3
Author: Carlos Garnacho <carlosg gnome org>
Date:   Tue May 10 16:38:48 2016 +0200

    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 bd2e2e5..003e998 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 9d5fbd6..cc1d28a 100644
--- a/src/wayland/meta-wayland-tablet-seat.c
+++ b/src/wayland/meta-wayland-tablet-seat.c
@@ -236,13 +236,15 @@ static const struct zwp_tablet_seat_v1_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 fc3be0f..653f695 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,


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]