mirror of
https://github.com/brl/mutter.git
synced 2024-11-21 07:30:42 -05:00
clutter: Fix event axes array indices in axis broadcasts
A clutter event's axes array is indexed by `ClutterInputAxis`.
However, a few lines accidentally use `ClutterInputAxisFlags` as
indices, reading incorrect values from elsewhere in memory. As a
result, broadcasted axis values for the tilt, rotation, and wheel
axes don't reflect actual event data.
Fixes: https://gitlab.gnome.org/GNOME/mutter/-/issues/1982
Part-of: <https://gitlab.gnome.org/GNOME/mutter/-/merge_requests/2065>
(cherry picked from commit af6fb2a702
)
This commit is contained in:
parent
42d6013bc5
commit
2f5c4bfc86
@ -702,8 +702,8 @@ broadcast_tilt (MetaWaylandTabletTool *tool,
|
||||
struct wl_resource *resource;
|
||||
gdouble xtilt, ytilt;
|
||||
|
||||
xtilt = event->motion.axes[CLUTTER_INPUT_AXIS_FLAG_XTILT];
|
||||
ytilt = event->motion.axes[CLUTTER_INPUT_AXIS_FLAG_YTILT];
|
||||
xtilt = event->motion.axes[CLUTTER_INPUT_AXIS_XTILT];
|
||||
ytilt = event->motion.axes[CLUTTER_INPUT_AXIS_YTILT];
|
||||
|
||||
wl_resource_for_each (resource, &tool->focus_resource_list)
|
||||
{
|
||||
@ -720,7 +720,7 @@ broadcast_rotation (MetaWaylandTabletTool *tool,
|
||||
struct wl_resource *resource;
|
||||
gdouble rotation;
|
||||
|
||||
rotation = event->motion.axes[CLUTTER_INPUT_AXIS_FLAG_ROTATION];
|
||||
rotation = event->motion.axes[CLUTTER_INPUT_AXIS_ROTATION];
|
||||
|
||||
wl_resource_for_each (resource, &tool->focus_resource_list)
|
||||
{
|
||||
@ -737,7 +737,7 @@ broadcast_wheel (MetaWaylandTabletTool *tool,
|
||||
gdouble angle;
|
||||
gint32 clicks = 0;
|
||||
|
||||
angle = event->motion.axes[CLUTTER_INPUT_AXIS_FLAG_WHEEL];
|
||||
angle = event->motion.axes[CLUTTER_INPUT_AXIS_WHEEL];
|
||||
|
||||
/* FIXME: Perform proper angle-to-clicks accumulation elsewhere */
|
||||
if (angle > 0.01)
|
||||
|
Loading…
Reference in New Issue
Block a user