[PATCH v2] evdev: use mtdev for multitouch devices

Daniel Stone daniel at fooishbar.org
Sat Mar 17 05:30:16 PDT 2012


Hi,

On 16 March 2012 20:33, Tiago Vignatti <tiago.vignatti at intel.com> wrote:
> @@ -334,7 +337,11 @@ evdev_input_device_data(int fd, uint32_t mask, void *data)
>        if (!ec->focus)
>                return 1;
>
> -       len = read(fd, &ev, sizeof ev);
> +       if (device->mtdev)
> +               len = mtdev_get(device->mtdev, fd, ev, NUM_EVENTS) *
> +                     sizeof (struct input_event);
> +       else
> +               len = read(fd, &ev, sizeof ev);
>        if (len < 0 || len % sizeof e[0] != 0) {
>                /* FIXME: call device_removed when errno is ENODEV. */;
>                return 1;

Since you're using O_NONBLOCK, you'll now need to handle -EAGAIN and
-EWOULDBLOCK from read().  The rest looks good to me though.

Cheers,
Daniel


More information about the wayland-devel mailing list