libevdev_event.c: skip ABS_MT_SLOT sync for non-MT devices
BUG=chromium:365231
TEST=on device, connect a USB mouse, no (EE) messages like
the following printed in /var/log/Xorg.0.log
(EE) cmt: USB Optical Mouse: EvdevProbeAbsinfo():228: ioctl EVIOCGABS(47) failed: Invalid argument
Change-Id: I0317a6448022a4d04415daaa3711c75e093fd03f
Reviewed-on: https://chromium-review.googlesource.com/195769
Reviewed-by: Chung-yih Wang <cywang@chromium.org>
Tested-by: Chung-yih Wang <cywang@chromium.org>
Commit-Queue: Chung-yih Wang <cywang@chromium.org>
diff --git a/src/libevdev_event.c b/src/libevdev_event.c
index a633cf1..cd69ba8 100755
--- a/src/libevdev_event.c
+++ b/src/libevdev_event.c
@@ -399,9 +399,11 @@
MT_Slot_Sync(device, &req);
}
- /* Get current slot id */
- if (EvdevProbeAbsinfo(device, ABS_MT_SLOT) == Success)
+ /* Get current slot id for multi-touch devices*/
+ if (TestBit(ABS_MT_SLOT, device->info.abs_bitmask) &&
+ (EvdevProbeAbsinfo(device, ABS_MT_SLOT) == Success)) {
MT_Slot_Set(device, device->info.absinfo[ABS_MT_SLOT].value);
+ }
Event_Get_Time(&device->after_sync_time, device->info.is_monotonic);