mirror of
https://github.com/brl/mutter.git
synced 2025-02-16 13:24:09 +00:00
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.
This commit is contained in:
parent
edda88a7dd
commit
98f26bf01a
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user