Skip to content

Commit 53145c2

Browse files
fooishbarJiri Kosina
authored andcommitted
Revert "HID: magicmouse: Set multi-touch keybits for Magic Mouse"
Setting these bits causes libinput to fail to initialize the device; setting BTN_TOUCH and BTN_TOOL_FINGER causes it to treat the mouse as a touchpad, and it then refuses to continue when it discovers ABS_X is not set. This breaks all known Wayland compositors, as well as Xorg when the libinput driver is being used. This reverts commit f4b65b9. Signed-off-by: Daniel Stone <[email protected]> Cc: Che-Liang Chiou <[email protected]> Cc: Thierry Escande <[email protected]> Cc: Jiri Kosina <[email protected]> Cc: Benjamin Tissoires <[email protected]> Acked-by: Benjamin Tissoires <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 3db2827 commit 53145c2

File tree

1 file changed

+7
-8
lines changed

1 file changed

+7
-8
lines changed

drivers/hid/hid-magicmouse.c

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,6 @@ static int magicmouse_raw_event(struct hid_device *hdev,
349349

350350
if (input->id.product == USB_DEVICE_ID_APPLE_MAGICMOUSE) {
351351
magicmouse_emit_buttons(msc, clicks & 3);
352-
input_mt_report_pointer_emulation(input, true);
353352
input_report_rel(input, REL_X, x);
354353
input_report_rel(input, REL_Y, y);
355354
} else { /* USB_DEVICE_ID_APPLE_MAGICTRACKPAD */
@@ -389,16 +388,16 @@ static int magicmouse_setup_input(struct input_dev *input, struct hid_device *hd
389388
__clear_bit(BTN_RIGHT, input->keybit);
390389
__clear_bit(BTN_MIDDLE, input->keybit);
391390
__set_bit(BTN_MOUSE, input->keybit);
391+
__set_bit(BTN_TOOL_FINGER, input->keybit);
392+
__set_bit(BTN_TOOL_DOUBLETAP, input->keybit);
393+
__set_bit(BTN_TOOL_TRIPLETAP, input->keybit);
394+
__set_bit(BTN_TOOL_QUADTAP, input->keybit);
395+
__set_bit(BTN_TOOL_QUINTTAP, input->keybit);
396+
__set_bit(BTN_TOUCH, input->keybit);
397+
__set_bit(INPUT_PROP_POINTER, input->propbit);
392398
__set_bit(INPUT_PROP_BUTTONPAD, input->propbit);
393399
}
394400

395-
__set_bit(BTN_TOOL_FINGER, input->keybit);
396-
__set_bit(BTN_TOOL_DOUBLETAP, input->keybit);
397-
__set_bit(BTN_TOOL_TRIPLETAP, input->keybit);
398-
__set_bit(BTN_TOOL_QUADTAP, input->keybit);
399-
__set_bit(BTN_TOOL_QUINTTAP, input->keybit);
400-
__set_bit(BTN_TOUCH, input->keybit);
401-
__set_bit(INPUT_PROP_POINTER, input->propbit);
402401

403402
__set_bit(EV_ABS, input->evbit);
404403

0 commit comments

Comments
 (0)