Go to file
Shawn Rutledge 83e70c3157 Use QVarLengthFlatMap for QPointingDevicePrivate::activePoints
It's good to use a pre-allocated set of points that never changes,
because queryPointById() returns a pointer to the stored instance.
If the flatmap's values are in a QList, and a mouse event comes in at
the wrong time while touchpoints are already stored there, causing
the QList to be resized, the returned pointer can become garbage.
The pointer returned from queryPointById() is never retained for long,
but in practice it turned out this could still happen, at least on X11
(perhaps because of X11 synthesizing mouse events from touch).

Using a pre-allocated QVarLengthFlatMap is also an optimization: events
on single-user systems are unlikely to ever cause memory allocation in
this part of the code.

Many touchscreens support up to 10 touchpoints, but the user might
have some other input devices, plus the "core pointer" (mouse).
The user could also have two touchscreens and try to use them
simultaneously.

d4611ba3a5 added QVarLengthFlatMap along
with a test using int keys; so we expect that will keep working now.
There was some issue in 2020 which is why I didn't use QVarLengthArray
for the QFlatMap key and value containers to begin with.

Pick-to: 6.2 6.3 6.4 6.4.0
Fixes: QTBUG-106223
Change-Id: I588f66f07126b9551937a369df44f045759b473d
Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
2022-09-06 12:34:43 +00:00
.github/workflows Repair github action workflow 2021-11-10 18:57:33 +01:00
bin Minor fixes for qt-configure-module 2022-06-27 17:55:19 +02:00
cmake wasm: suppress pthreads-mem-growth warning 2022-09-06 10:48:10 +02:00
coin Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
config.tests Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
dist Add Qt 6.0.0 changes file 2020-11-16 10:02:08 +02:00
doc CMake: Add reference documentation for QT_IOS_LAUNCH_SCREEN 2022-09-02 17:00:23 +02:00
examples Add CBOR documentation 2022-09-01 19:03:00 +02:00
lib
libexec Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
LICENSES Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
mkspecs wasm: set ALLOW_MEMORY_GROWTH for multi-threaded builds 2022-09-01 15:42:28 +02:00
qmake Move qVersion() from qglobal.h to qlibraryinfo.h 2022-09-01 13:26:30 +02:00
src Use QVarLengthFlatMap for QPointingDevicePrivate::activePoints 2022-09-06 12:34:43 +00:00
tests tst_qmatrixnxn: port away from deprecated APIs 2022-09-06 13:59:57 +02:00
util xcb: use libxcb-cursor to replace Xlib/libXcursor 2022-09-06 11:21:43 +02:00
.cmake.conf Bump version to 6.5.0 2022-06-06 13:23:59 +03:00
.gitattributes Give batch files CRLF line endings 2020-11-04 15:02:29 +00:00
.gitignore Assume qhelpgenerator in libexec instead of bin 2021-11-08 19:27:32 +01:00
.lgtm.yml Skip LGTM analysis for the bootstrap library and tools 2020-07-16 01:04:34 +02:00
.tag
CMakeLists.txt Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
conanfile.py Conan: Do not force 'qt_host_path' usage in cross-build context 2022-06-22 18:18:42 +03:00
config_help.txt Add -disable-deprecated-up-to parameter to configure script 2022-08-19 23:52:05 +02:00
configure Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
configure.bat Use SPDX license identifiers 2022-05-16 16:37:38 +02:00
configure.cmake wasm: add support for building Qt as shared libraries 2022-08-30 22:11:01 +10:00
dependencies.yaml
qt_cmdline.cmake Change the license of all CMakeLists.txt and *.cmake files to BSD 2022-08-23 23:58:42 +02:00
sync.profile Remove deprecated qgl.h from sync.profile 2022-06-11 00:42:13 +02:00