diff options
author | Rolf Eike Beer <eb@emlix.com> | 2014-03-06 11:10:44 +0100 |
---|---|---|
committer | The Qt Project <gerrit-noreply@qt-project.org> | 2014-03-06 17:22:55 +0100 |
commit | 9ba7cc07dbef542bc73f97f1d7458699d25fbb8d (patch) | |
tree | 550c0a3a24225dec154f081bb4349518b21e6ce8 /src/plugins/generic | |
parent | 82288308ecbe1481d82bee78ec59855b69d24391 (diff) |
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>
Diffstat (limited to 'src/plugins/generic')
-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 9905d9cc9e..0dcf5bc6ca 100644 --- a/src/plugins/generic/tslib/qtslib.cpp +++ b/src/plugins/generic/tslib/qtslib.cpp @@ -110,12 +110,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 @@ -123,12 +128,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); |