summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowspointerhandler.cpp
diff options
context:
space:
mode:
authorLiang Qi <liang.qi@qt.io>2018-12-07 20:25:11 +0000
committerThe Qt Project <gerrit-noreply@qt-project.org>2018-12-07 20:55:07 +0000
commit153726bc167406414f589f72bea76c3229cfa815 (patch)
tree5c3b86e9f70a00f3a7be4b5fedbe38d974949d41 /src/plugins/platforms/windows/qwindowspointerhandler.cpp
parente27f52a09893cf494fc9b93452ed160f2effb94b (diff)
parentaec026fe1ef8ff62a6138cc49040dd82d815d3ce (diff)
Merge "Merge remote-tracking branch 'origin/5.12.0' into 5.12" into refs/staging/5.12
Diffstat (limited to 'src/plugins/platforms/windows/qwindowspointerhandler.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowspointerhandler.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowspointerhandler.cpp b/src/plugins/platforms/windows/qwindowspointerhandler.cpp
index 14559d726a..7935d0c36f 100644
--- a/src/plugins/platforms/windows/qwindowspointerhandler.cpp
+++ b/src/plugins/platforms/windows/qwindowspointerhandler.cpp
@@ -582,6 +582,7 @@ bool QWindowsPointerHandler::translateTouchEvent(QWindow *window, HWND hwnd,
QList<QWindowSystemInterface::TouchPoint> touchPoints;
bool primaryPointer = false;
+ bool pressRelease = false;
if (QWindowsContext::verbose > 1)
qCDebug(lcQpaEvents).noquote().nospace() << showbase
@@ -618,9 +619,11 @@ bool QWindowsPointerHandler::translateTouchEvent(QWindow *window, HWND hwnd,
if (touchInfo[i].pointerInfo.pointerFlags & POINTER_FLAG_DOWN) {
touchPoint.state = Qt::TouchPointPressed;
m_lastTouchPositions.insert(touchPoint.id, touchPoint.normalPosition);
+ pressRelease = true;
} else if (touchInfo[i].pointerInfo.pointerFlags & POINTER_FLAG_UP) {
touchPoint.state = Qt::TouchPointReleased;
m_lastTouchPositions.remove(touchPoint.id);
+ pressRelease = true;
} else {
touchPoint.state = stationaryTouchPoint ? Qt::TouchPointStationary : Qt::TouchPointMoved;
m_lastTouchPositions.insert(touchPoint.id, touchPoint.normalPosition);
@@ -633,7 +636,7 @@ bool QWindowsPointerHandler::translateTouchEvent(QWindow *window, HWND hwnd,
// Avoid getting repeated messages for this frame if there are multiple pointerIds
QWindowsContext::user32dll.skipPointerFrameMessages(touchInfo[i].pointerInfo.pointerId);
}
- if (primaryPointer) {
+ if (primaryPointer && !pressRelease) {
// Postpone event delivery to avoid hanging inside DoDragDrop().
// Only the primary pointer will generate mouse messages.
enqueueTouchEvent(window, touchPoints, QWindowsKeyMapper::queryKeyboardModifiers());