diff options
author | Rolf Eike Beer <eb@emlix.com> | 2014-03-06 10:10:44 (GMT) |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-05-15 13:50:15 (GMT) |
commit | bcf37100f5d5c78920592d39cc3dcaa96814f63a (patch) | |
tree | a4b54526673fe3ad1d5dff94009974a3bca5569d /src | |
parent | 890c11e0eee11f5a2045a8b43d498c2ec63130e1 (diff) | |
download | Qt-bcf37100f5d5c78920592d39cc3dcaa96814f63a.zip Qt-bcf37100f5d5c78920592d39cc3dcaa96814f63a.tar.gz Qt-bcf37100f5d5c78920592d39cc3dcaa96814f63a.tar.bz2 |
Tslib plugin: also apply missing release coordinate code to non-raw mode
Even if the normal mode is used the release events may have zero coordinates.
Change-Id: I2eac8cf50dfcf9e62d8cec2423419a6579266849
Reviewed-by: Laszlo Agocs <laszlo.agocs@digia.com>
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@digia.com>
(cherry picked from qtbase/9ba7cc07dbef542bc73f97f1d7458699d25fbb8d)
Diffstat (limited to 'src')
-rw-r--r-- | src/plugins/generic/tslib/qtslib.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/src/plugins/generic/tslib/qtslib.cpp b/src/plugins/generic/tslib/qtslib.cpp index 60cad8a..965c97b 100644 --- a/src/plugins/generic/tslib/qtslib.cpp +++ b/src/plugins/generic/tslib/qtslib.cpp @@ -109,12 +109,17 @@ static bool get_sample(struct tsdev *dev, struct ts_sample *sample, bool rawMode void QTsLibMouseHandler::readMouseData() { ts_sample sample; - while (get_sample(m_dev, &sample, m_rawMode)) { + while (get_sample(m_dev, &sample, m_rawMode)) { bool pressed = sample.pressure; 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) { + x = m_x; + y = m_y; + } if (!m_rawMode) { //filtering: ignore movements of 2 pixels or less @@ -122,12 +127,6 @@ void QTsLibMouseHandler::readMouseData() int dy = y - m_y; if (dx*dx <= 4 && dy*dy <= 4 && pressed == m_pressed) continue; - } else { - // work around missing coordinates on mouse release in raw mode - if (sample.pressure == 0 && sample.x == 0 && sample.y == 0) { - x = m_x; - y = m_y; - } } QPoint pos(x, y); |