Don't sync mt axes that don't exist

Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
Peter Hutterer 2013-07-01 14:39:53 +10:00
parent 6f78a7adab
commit cca3cc95af

View file

@ -352,6 +352,9 @@ sync_mt_state(struct libevdev *dev)
if (i == ABS_MT_SLOT)
continue;
if (!libevdev_has_event_code(dev, EV_ABS, i))
continue;
idx = i - ABS_MT_MIN;
mt_state[idx].code = i;
rc = ioctl(dev->fd, EVIOCGMTSLOTS(sizeof(struct mt_state)), &mt_state[idx]);
@ -371,6 +374,9 @@ sync_mt_state(struct libevdev *dev)
if (j == ABS_MT_SLOT)
continue;
if (!libevdev_has_event_code(dev, EV_ABS, j))
continue;
if (dev->mt_slot_vals[i][jdx] == mt_state[jdx].val[i])
continue;