Skip to content

Commit bb5f0c8

Browse files
JoseExpositobentiss
authored andcommitted
HID: magicmouse: Do not set BTN_MOUSE on double report
Under certain conditions the Magic Trackpad can group 2 reports in a single packet. The packet is split and the raw event function is invoked recursively for each part. However, after processing each part, the BTN_MOUSE status is updated, sending multiple click events. [1] Return after processing double reports to avoid this issue. Link: https://gitlab.freedesktop.org/libinput/libinput/-/issues/811 # [1] Fixes: a462230 ("HID: magicmouse: enable Magic Trackpad support") Reported-by: Nulo <[email protected]> Signed-off-by: José Expósito <[email protected]> Signed-off-by: Benjamin Tissoires <[email protected]> Link: https://lore.kernel.org/r/[email protected]
1 parent 79d11de commit bb5f0c8

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/hid/hid-magicmouse.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -480,7 +480,7 @@ static int magicmouse_raw_event(struct hid_device *hdev,
480480
magicmouse_raw_event(hdev, report, data + 2, data[1]);
481481
magicmouse_raw_event(hdev, report, data + 2 + data[1],
482482
size - 2 - data[1]);
483-
break;
483+
return 0;
484484
default:
485485
return 0;
486486
}

0 commit comments

Comments
 (0)