Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 6a66bbd6 authored by Chase Douglas's avatar Chase Douglas Committed by Jiri Kosina
Browse files

HID: magicmouse: Don't report REL_{X,Y} for Magic Trackpad



With the recent switch to having the hid layer handle standard axis
initialization, the Magic Trackpad now reports relative axes. This would
be fine in the normal mode, but the driver puts the device in multitouch
mode where no relative events are generated. Also, userspace software
depends on accurate axis information for device type detection. Thus,
ignoring the relative axes from the Magic Trackpad is best.

Signed-off-by: default avatarChase Douglas <chase.douglas@canonical.com>
Signed-off-by: default avatarJiri Kosina <jkosina@suse.cz>
parent 59e57c62
Loading
Loading
Loading
Loading
+5 −0
Original line number Diff line number Diff line
@@ -433,6 +433,11 @@ static int magicmouse_input_mapping(struct hid_device *hdev,
	if (!msc->input)
		msc->input = hi->input;

	/* Magic Trackpad does not give relative data after switching to MT */
	if (hi->input->id.product == USB_DEVICE_ID_APPLE_MAGICTRACKPAD &&
	    field->flags & HID_MAIN_ITEM_RELATIVE)
		return -1;

	return 0;
}