diff options
author | Quytelda Kahja <quytelda@tamalin.org> | 2021-10-27 23:15:50 -0700 |
---|---|---|
committer | Florian Müllner <fmuellner@gnome.org> | 2021-11-02 16:15:10 +0100 |
commit | 8d2e3424e801fb75df8b340b40d6f2d69f873100 (patch) | |
tree | 17163df2f43ec3a0f3da455847d38d9a392853f6 | |
parent | d52593ebc3d8879f86a3ad879829b35088583411 (diff) | |
download | mutter-8d2e3424e801fb75df8b340b40d6f2d69f873100.tar.gz |
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 af6fb2a702fe3a7675b243dea7a210d635403cc2)
-rw-r--r-- | src/wayland/meta-wayland-tablet-tool.c | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/wayland/meta-wayland-tablet-tool.c b/src/wayland/meta-wayland-tablet-tool.c index a8de868bc..51e4e7d5d 100644 --- a/src/wayland/meta-wayland-tablet-tool.c +++ b/src/wayland/meta-wayland-tablet-tool.c @@ -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) |