Commit fc9f490a authored by Peter Hutterer's avatar Peter Hutterer

eventcomm: ignore fake and broken MT devices

An MT device without X/Y is not a touchpad. And neither are fake MT devices.
Signed-off-by: Peter Hutterer's avatarPeter Hutterer <>
Reviewed-by: default avatarHans de Goede <>
parent 30866b97
......@@ -325,6 +325,15 @@ event_query_is_touchpad(struct libevdev *evdev)
libevdev_has_event_code(evdev, EV_ABS, BTN_TOOL_PEN)) /* Don't match wacom tablets */
return FALSE;
if (libevdev_has_event_code(evdev, EV_ABS, ABS_MT_SLOT)) {
if (libevdev_get_num_slots(evdev) == -1)
return FALSE; /* Ignore fake MT devices */
if (!libevdev_has_event_code(evdev, EV_ABS, ABS_MT_POSITION_X) ||
!libevdev_has_event_code(evdev, EV_ABS, ABS_MT_POSITION_Y))
return FALSE;
return TRUE;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment