When QXcbConnection::xi2SetupDevices() reacts to a device hierarchy event and re-discovers an already-known slave device, it doesn't call xi2SetupSlavePointerDevice() again. I.e. it won't attempt to add it to m_touchDevices or m_tabletData because it was already known. So it should not clear m_touchDevices or m_tabletData either, but only remove the touch devices that are known to have disappeared. Tablet styli normally come and go from proximity, so it's ok to avoid deleting the corresponding device data. Also fix some other failure cases after testing hotplugging more with tests/manual/inputdevices: there should be no crashes, no duplicated devices after plugging (although the QAIM might have a bug that makes it look that way), no leftover instances after unplugging. Amends 2a9d93efc68324ce5e41831ea46a3945f1c4531d Fixes: QTBUG-114334 Change-Id: I30f5e532f7dd3a465d56ecdd34d893cbadbf0453 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> (cherry picked from commit a8a75d2c4b0f50f4029aac76d09657d8bbab1295) Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
Description
Languages
C++
84.3%
HTML
4.9%
C
3.9%
CMake
3.6%
Objective-C++
2%
Other
0.8%