From 062b696df2688b9ecff393f12f0b8eacd27e0d2e Mon Sep 17 00:00:00 2001 From: Carlos Garnacho Date: Thu, 30 Jun 2016 18:37:49 +0200 Subject: [PATCH] wayland: Add method to relate a pad ring to its group --- src/wayland/meta-wayland-tablet-pad-ring.c | 12 ++++++++++++ src/wayland/meta-wayland-tablet-pad-ring.h | 3 +++ 2 files changed, 15 insertions(+) diff --git a/src/wayland/meta-wayland-tablet-pad-ring.c b/src/wayland/meta-wayland-tablet-pad-ring.c index aee026503..ee138e025 100644 --- a/src/wayland/meta-wayland-tablet-pad-ring.c +++ b/src/wayland/meta-wayland-tablet-pad-ring.c @@ -33,6 +33,7 @@ #include "meta-surface-actor-wayland.h" #include "meta-wayland-private.h" #include "meta-wayland-tablet-pad.h" +#include "meta-wayland-tablet-pad-group.h" #include "meta-wayland-tablet-pad-ring.h" static void @@ -193,3 +194,14 @@ meta_wayland_tablet_pad_ring_sync_focus (MetaWaylandTabletPadRing *ring) wl_resource_get_client (ring->pad->focus_surface->resource)); } } + +void +meta_wayland_tablet_pad_ring_set_group (MetaWaylandTabletPadRing *ring, + MetaWaylandTabletPadGroup *group) +{ + /* Group is static, can only be set once */ + g_assert (ring->group == NULL); + + ring->group = group; + group->rings = g_list_append (group->rings, ring); +} diff --git a/src/wayland/meta-wayland-tablet-pad-ring.h b/src/wayland/meta-wayland-tablet-pad-ring.h index 6bf31bf4c..2de4b3434 100644 --- a/src/wayland/meta-wayland-tablet-pad-ring.h +++ b/src/wayland/meta-wayland-tablet-pad-ring.h @@ -32,6 +32,7 @@ struct _MetaWaylandTabletPadRing { MetaWaylandTabletPad *pad; + MetaWaylandTabletPadGroup *group; struct wl_list resource_list; struct wl_list focus_resource_list; @@ -42,6 +43,8 @@ struct _MetaWaylandTabletPadRing MetaWaylandTabletPadRing * meta_wayland_tablet_pad_ring_new (MetaWaylandTabletPad *pad); void meta_wayland_tablet_pad_ring_free (MetaWaylandTabletPadRing *ring); +void meta_wayland_tablet_pad_ring_set_group (MetaWaylandTabletPadRing *ring, + MetaWaylandTabletPadGroup *group); struct wl_resource * meta_wayland_tablet_pad_ring_create_new_resource (MetaWaylandTabletPadRing *ring, struct wl_client *client,