mirror of
https://gitlab.freedesktop.org/libevdev/libevdev.git
synced 2025-12-22 20:40:06 +01:00
Don't sync mt axes that don't exist
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
6f78a7adab
commit
cca3cc95af
1 changed files with 6 additions and 0 deletions
|
|
@ -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;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue