Skip to content

Commit

Permalink
HID: magicmouse: properly account for scroll movement in state
Browse files Browse the repository at this point in the history
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: Chase Douglas <chase.douglas@canonical.com>
Acked-by: Michael Poole <mdpoole@troilus.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
  • Loading branch information
Chase Douglas authored and Jiri Kosina committed Jun 24, 2010
1 parent 9846f35 commit 8d93efb
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/hid/hid-magicmouse.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
}
Expand Down

0 comments on commit 8d93efb

Please sign in to comment.