From: Peter Hutterer Date: Tue, 1 Apr 2014 05:12:56 +0000 (+1000) Subject: Only sync the initial MT state for Protocol B devices X-Git-Tag: libevdev-1.1.99.1~12 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=ca082d5fcbe26edf13632a16a7a4d09f680296f6;p=platform%2Fupstream%2Flibevdev.git Only sync the initial MT state for Protocol B devices 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 Reviewed-by: Benjamin Tissoires --- 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)) + sync_mt_state(dev, 0); rc = init_event_queue(dev); if (rc < 0) {