Commit 8d93efb2 authored by Chase Douglas's avatar Chase Douglas Committed by Jiri Kosina

HID: magicmouse: properly account for scroll movement in state

Before this change, sequential scroll events would take a variable
amount of movement due to incorrect accounting. This change ensures all
scroll movements require a deterministic touch movement for an action to
occur.
Signed-off-by: default avatarChase Douglas <chase.douglas@canonical.com>
Acked-by: default avatarMichael Poole <mdpoole@troilus.org>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 9846f350
......@@ -189,7 +189,8 @@ static void magicmouse_emit_touch(struct magicmouse_sc *msc, int raw_id, u8 *tda
case TOUCH_STATE_DRAG:
step = step / accel_profile[msc->scroll_accel];
if (step != 0) {
msc->touches[id].scroll_y = y;
msc->touches[id].scroll_y -=
step * accel_profile[msc->scroll_accel];
msc->scroll_jiffies = now;
input_report_rel(input, REL_WHEEL, step);
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment