[PATCH weston 05/10] evdev: check for ABS_MT_POSITION_X/Y to determine mt devices

Daniel Stone daniel at fooishbar.org
Wed Aug 7 01:14:47 PDT 2013


Hi,

On 7 August 2013 02:04, Peter Hutterer <peter.hutterer at who-t.net> wrote:
> mtdev as currently used in weston is a noop. mtdev's purpose is to convert
> Protocol A devices (without ABS_MT_SLOT) to Protocol B devices (slots).
> For Protocol B devices mtdev merely routes the events, so checking for
> slots and then using mtdev based on that adds no functionality.
>
> Check for ABS_MT_POSITION_X/Y instead and use that to categorise a device
> as MT device. mtdev will provide us with a slotted protocol for all devices.

Could you please add a comment to this effect? Looks good otherwise tho.

Cheers,
Daniel

> ---
>  src/evdev.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/src/evdev.c b/src/evdev.c
> index 4f3f8cf..7a379c5 100644
> --- a/src/evdev.c
> +++ b/src/evdev.c
> @@ -455,7 +455,8 @@ evdev_handle_device(struct evdev_device *device)
>                         device->abs.max_y = absinfo.maximum;
>                         device->caps |= EVDEV_MOTION_ABS;
>                 }
> -               if (TEST_BIT(abs_bits, ABS_MT_SLOT)) {
> +               if (TEST_BIT(abs_bits, ABS_MT_POSITION_X) &&
> +                   TEST_BIT(abs_bits, ABS_MT_POSITION_Y)) {
>                         ioctl(device->fd, EVIOCGABS(ABS_MT_POSITION_X),
>                               &absinfo);
>                         device->abs.min_x = absinfo.minimum;
> --
> 1.8.2.1
>
> _______________________________________________
> wayland-devel mailing list
> wayland-devel at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/wayland-devel


More information about the wayland-devel mailing list