[PATCH synaptics] eventcomm: ignore fake and broken MT devices
Hans de Goede
hdegoede at redhat.com
Tue Mar 24 01:07:47 PDT 2015
Hi,
On 24-03-15 06:45, Peter Hutterer wrote:
> An MT device without X/Y is not a touchpad. And neither are fake MT devices.
>
> Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
Looks good:
Reviewed-by: Hans de Goede <hdegoede at redhat.com>
Regards,
Hans
> ---
> src/eventcomm.c | 9 +++++++++
> 1 file changed, 9 insertions(+)
>
> diff --git a/src/eventcomm.c b/src/eventcomm.c
> index cddf7fc..3a9d45d 100644
> --- a/src/eventcomm.c
> +++ b/src/eventcomm.c
> @@ -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;
> }
>
>
More information about the xorg-devel
mailing list