[mutter/wip/tablet-protocol-v2: 144/149] wayland: Fix label lookup on >1 strips/rings
- From: Carlos Garnacho <carlosg src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [mutter/wip/tablet-protocol-v2: 144/149] wayland: Fix label lookup on >1 strips/rings
- Date: Wed, 20 Jul 2016 17:45:36 +0000 (UTC)
commit 98f26bf01ac41c115054a371b552e8cbff6b881e
Author: Carlos Garnacho <carlosg gnome org>
Date: Thu Jun 30 18:48:44 2016 +0200
wayland: Fix label lookup on >1 strips/rings
We assumed that each group could only have 1 strip and/or ring, because
accounting is performed per group, so we could not assume the real
index for anything above 1. Get rid of this restriction, now that
MetaWaylandTabletPad does its own accounting of rings/strips, alongside
groups.
src/wayland/meta-wayland-tablet-pad.c | 14 ++------------
1 files changed, 2 insertions(+), 12 deletions(-)
---
diff --git a/src/wayland/meta-wayland-tablet-pad.c b/src/wayland/meta-wayland-tablet-pad.c
index 0e1bace..32c734a 100644
--- a/src/wayland/meta-wayland-tablet-pad.c
+++ b/src/wayland/meta-wayland-tablet-pad.c
@@ -571,28 +571,18 @@ meta_wayland_tablet_pad_get_label (MetaWaylandTabletPad *pad,
break;
case META_PAD_ACTION_RING:
{
- MetaWaylandTabletPadGroup *group;
MetaWaylandTabletPadRing *ring;
- /* FIXME: Assuming each group gets 1 */
- group = g_list_nth_data (pad->groups, action);
- if (!group)
- break;
- ring = g_list_nth_data (group->rings, 0);
+ ring = g_list_nth_data (pad->rings, action);
if (ring)
label = ring->feedback;
break;
}
case META_PAD_ACTION_STRIP:
{
- MetaWaylandTabletPadGroup *group;
MetaWaylandTabletPadStrip *strip;
- /* FIXME: Assuming each group gets 1 */
- group = g_list_nth_data (pad->groups, action);
- if (!group)
- break;
- strip = g_list_nth_data (group->strips, 0);
+ strip = g_list_nth_data (pad->strips, action);
if (strip)
label = strip->feedback;
break;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]