diff options
author | Rolf Eike Beer <eb@emlix.com> | 2019-03-25 12:39:56 +0100 |
---|---|---|
committer | Rolf Eike Beer <eb@emlix.com> | 2019-04-11 08:28:55 +0000 |
commit | e1167ed650afae90ab4b73036f58ae0f416ae500 (patch) | |
tree | 3abdee39b351d94829b9b12f47c40d3fa6baacaf | |
parent | 064a731a110efc5ad7e314bc686f74c759f39437 (diff) |
tslib: fix detection of missing release coordinates
The release coordinates may be simply initialized to 0 in lower levels of the
tslib. They are then passed through the calibration stage, which applies
offset and multiplication to them, so they may end up even as positive numbers.
Since we can't know if we can trust them or not simply ignore all release
coordinates and just always use the ones from the previous event.
Change-Id: Ib845b5ab1c5b81967cc089d601576893f433fa4a
Reviewed-by: Martin Kepplinger <martink@posteo.de>
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
-rw-r--r-- | src/platformsupport/input/tslib/qtslib.cpp | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/platformsupport/input/tslib/qtslib.cpp b/src/platformsupport/input/tslib/qtslib.cpp index 84a468f60c..7609416fea 100644 --- a/src/platformsupport/input/tslib/qtslib.cpp +++ b/src/platformsupport/input/tslib/qtslib.cpp @@ -114,8 +114,8 @@ void QTsLibMouseHandler::readMouseData() int x = sample.x; int y = sample.y; - // work around missing coordinates on mouse release - if (sample.pressure == 0 && sample.x == 0 && sample.y == 0) { + // coordinates on release events can contain arbitrary values, just ignore them + if (sample.pressure == 0) { x = m_x; y = m_y; } |