Skip to content

Commit fd35759

Browse files
whotbentiss
authored andcommitted
HID: logitech: Handle 0 scroll events for the m560
hidpp_scroll_counter_handle_scroll() doesn't expect a 0-value scroll event, it gets interpreted as a negative scroll direction event. This can cause scroll direction resets and thus broken scrolling. Fixes: 4435ff2 ("HID: logitech: Enable high-resolution scrolling on Logitech mice") Cc: [email protected] # v5.0 Reported-and-tested-by: Aimo Metsälä <[email protected]> Signed-off-by: Peter Hutterer <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]>
1 parent cef0d49 commit fd35759

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

drivers/hid/hid-logitech-hidpp.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2614,8 +2614,9 @@ static int m560_raw_event(struct hid_device *hdev, u8 *data, int size)
26142614
input_report_rel(mydata->input, REL_Y, v);
26152615

26162616
v = hid_snto32(data[6], 8);
2617-
hidpp_scroll_counter_handle_scroll(
2618-
&hidpp->vertical_wheel_counter, v);
2617+
if (v != 0)
2618+
hidpp_scroll_counter_handle_scroll(
2619+
&hidpp->vertical_wheel_counter, v);
26192620

26202621
input_sync(mydata->input);
26212622
}

0 commit comments

Comments
 (0)