diff options
author | Chase Douglas <chase.douglas@canonical.com> | 2010-06-20 21:32:29 -0400 |
---|---|---|
committer | Jiri Kosina <jkosina@suse.cz> | 2010-06-24 04:48:03 -0400 |
commit | 8d93efb27ab8927ffc7a357f1b2d10039de50ed4 (patch) | |
tree | 1ffc1eaff7f116243d8a84ae6944b4fb985b8616 /drivers | |
parent | 9846f350ef4d4108c1154acfc125fe8d8630ef84 (diff) |
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: Chase Douglas <chase.douglas@canonical.com>
Acked-by: Michael Poole <mdpoole@troilus.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/hid/hid-magicmouse.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/hid/hid-magicmouse.c b/drivers/hid/hid-magicmouse.c index 4c4a79c760a2..f44aaf21e1e2 100644 --- a/drivers/hid/hid-magicmouse.c +++ b/drivers/hid/hid-magicmouse.c | |||
@@ -189,7 +189,8 @@ static void magicmouse_emit_touch(struct magicmouse_sc *msc, int raw_id, u8 *tda | |||
189 | case TOUCH_STATE_DRAG: | 189 | case TOUCH_STATE_DRAG: |
190 | step = step / accel_profile[msc->scroll_accel]; | 190 | step = step / accel_profile[msc->scroll_accel]; |
191 | if (step != 0) { | 191 | if (step != 0) { |
192 | msc->touches[id].scroll_y = y; | 192 | msc->touches[id].scroll_y -= |
193 | step * accel_profile[msc->scroll_accel]; | ||
193 | msc->scroll_jiffies = now; | 194 | msc->scroll_jiffies = now; |
194 | input_report_rel(input, REL_WHEEL, step); | 195 | input_report_rel(input, REL_WHEEL, step); |
195 | } | 196 | } |