[PATCH libevdev 3/6] Only sync the initial MT state for Protocol B devices

Peter Hutterer peter.hutterer at who-t.net
Wed Apr 2 19:10:42 PDT 2014


On Wed, Apr 02, 2014 at 07:11:40PM -0400, Benjamin Tissoires wrote:
> On Tue, Apr 1, 2014 at 10:17 PM, Peter Hutterer
> <peter.hutterer at who-t.net> wrote:
> > For protocol A devices we won't get the information from the kernel anyway and
> > we expect all axes to be updated in the next event.
> >
> > Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
> > ---
> >  libevdev/libevdev.c | 4 +++-
> >  1 file changed, 3 insertions(+), 1 deletion(-)
> >
> > diff --git a/libevdev/libevdev.c b/libevdev/libevdev.c
> > index 99e86a0..e2070d4 100644
> > --- a/libevdev/libevdev.c
> > +++ b/libevdev/libevdev.c
> > @@ -395,7 +395,9 @@ libevdev_set_fd(struct libevdev* dev, int fd)
> >         }
> >
> >         dev->fd = fd;
> > -       sync_mt_state(dev, 0);
> > +       if (!libevdev_has_event_code(dev, EV_ABS, ABS_MT_SLOT - 1) &&
> > +           libevdev_has_event_code(dev, EV_ABS, ABS_MT_SLOT))
> 
> Can't this check be extracted in some kind of
> libevdev_is_multitouch_protocol_B() ?
> Actually it's not used in the same way elsewher in the code, but it
> still took me a second to understand what are those checks.

Yeah, good point. But with patch 5/6 this is now immediately
preceded with a comment explaining it so I don't think this is necessary
anymore.

Cheers,
   Peter

> 
> > +           sync_mt_state(dev, 0);
> >
> >         rc = init_event_queue(dev);
> >         if (rc < 0) {
> > --
> > 1.9.0
> >
> > _______________________________________________
> > Input-tools mailing list
> > Input-tools at lists.freedesktop.org
> > http://lists.freedesktop.org/mailman/listinfo/input-tools


More information about the Input-tools mailing list