... as XI2 reuses device ids and we might end up with some bogus
objects in m_touchDevices (the same touch device after reconnecting
might have a new device id).
With this patch, m_touchDevices is handled similarly to tablets
and scolling devices. This patch also removes unnecessary calls
to X (XIQueryDevice). We already have device information available
for all devices when populating m_touchDevices list, so calling
XIQueryDevice again for every device id (which we haven't already
concluded to be a tablet device) is a redundant round trip to X.
For consistency with other device types, extend touch device data
structure to store the necessary device details, instead of holding
pointers to XIDeviceInfo. And allocate touch device objects on
stack instead of heap, also for the consistency reasons (this way
we won't need to special case m_touchDevices when running some
management task on _all_ devices, e.g. removing a device with id=n
when it was disconnected).
Change-Id: I9f6edfaf24da911dd21ec45cd48dfdd6d0dcdf8b
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>