Details
-
Bug
-
Resolution: Done
-
P2: Important
-
5.6.1, 5.10.1
-
None
-
{noformat}
Qt 5.6.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 4.8.3) on "xcb"
OS: Red Hat Enterprise Linux Server 7.2 (Maipo) [linux version 3.10.0-693.2.2.el7.x86_64]
> xinput
⎡ Virtual core pointer id=2 [master pointer (3)]
⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)]
⎜ ↳ VirtualPS/2 VMware VMMouse id=11 [slave pointer (2)]
⎜ ↳ VirtualPS/2 VMware VMMouse id=12 [slave pointer (2)]
⎜ ↳ Wacom Cintiq 21UX stylus id=7 [slave pointer (2)]
⎜ ↳ Wacom Cintiq 21UX eraser id=8 [slave pointer (2)]
⎜ ↳ Wacom Cintiq 21UX pad id=9 [slave pointer (2)]
⎜ ↳ Chicony HP Elite USB Keyboard id=13 [slave pointer (2)]
⎜ ↳ PixArt USB Optical Mouse id=15 [slave pointer (2)]
⎣ Virtual core keyboard id=3 [master keyboard (2)]
↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)]
↳ Power Button id=6 [slave keyboard (3)]
↳ AT Translated Set 2 keyboard id=10 [slave keyboard (3)]
↳ Chicony HP Elite USB Keyboard id=14 [slave keyboard (3)]
{noformat}{noformat} Qt 5.6.1 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 4.8.3) on "xcb" OS: Red Hat Enterprise Linux Server 7.2 (Maipo) [linux version 3.10.0-693.2.2.el7.x86_64] > xinput ⎡ Virtual core pointer id=2 [master pointer (3)] ⎜ ↳ Virtual core XTEST pointer id=4 [slave pointer (2)] ⎜ ↳ VirtualPS/2 VMware VMMouse id=11 [slave pointer (2)] ⎜ ↳ VirtualPS/2 VMware VMMouse id=12 [slave pointer (2)] ⎜ ↳ Wacom Cintiq 21UX stylus id=7 [slave pointer (2)] ⎜ ↳ Wacom Cintiq 21UX eraser id=8 [slave pointer (2)] ⎜ ↳ Wacom Cintiq 21UX pad id=9 [slave pointer (2)] ⎜ ↳ Chicony HP Elite USB Keyboard id=13 [slave pointer (2)] ⎜ ↳ PixArt USB Optical Mouse id=15 [slave pointer (2)] ⎣ Virtual core keyboard id=3 [master keyboard (2)] ↳ Virtual core XTEST keyboard id=5 [slave keyboard (3)] ↳ Power Button id=6 [slave keyboard (3)] ↳ AT Translated Set 2 keyboard id=10 [slave keyboard (3)] ↳ Chicony HP Elite USB Keyboard id=14 [slave keyboard (3)] {noformat}
Description
In QXcbConnection::compressEvent, if an XI_Motion event is from a tablet device it will not be compressed. The code casts an xcb_generic_event_t to xXIDeviceEvent to access the sourceid field.
// compress XI_Motion, but not from tablet devices if (isXIType(event, m_xiOpCode, XI_Motion)) { #ifndef QT_NO_TABLETEVENT xXIDeviceEvent *xdev = reinterpret_cast<xXIDeviceEvent *>(event); if (const_cast<QXcbConnection *>(this)->tabletDataForDevice(xdev->sourceid)) return false; ....
// it is safe to cast XI_* events here as long as we are only touching the first 32 bytes, // after that position event needs memmove, see xi2PrepareXIGenericDeviceEvent
The sourceid field is past the first 32 bytes, so it will be reading the wrong data.
If there is a tablet device with an id that matches this data, the event will not be compressed even if its from a mouse device which can cause reduced performance in the application.