diff options
author | Andre de la Rocha <andre.rocha@qt.io> | 2018-11-15 17:19:23 +0100 |
---|---|---|
committer | Jani Heikkinen <jani.heikkinen@qt.io> | 2018-11-16 05:51:45 +0000 |
commit | 8e8c11f4f3d5ccb8b1a9042d363e4d1639797df3 (patch) | |
tree | 95ce44e742ee512223b94ab9ef6f853253704bdc | |
parent | 900b57ea90ebe60414a5188337bc85ee4faac220 (diff) |
Windows QPA: Fix onPressedChanged only reported on touch upv5.12.0-rc1
This issue was caused by the workaround added to fix QTBUG-70887.
Certain events like the initial touch down do not generate mouse
messages after the pointer messages (but only touch messages) and
should not be postponed by the pointer handler.
Fixes: QTBUG-71775
Change-Id: I7b64ae4d422f6a4c1bb465ce5f8255e85640dab1
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
-rw-r--r-- | src/plugins/platforms/windows/qwindowspointerhandler.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/plugins/platforms/windows/qwindowspointerhandler.cpp b/src/plugins/platforms/windows/qwindowspointerhandler.cpp index 3c7372958f..b3bc6e6d7b 100644 --- a/src/plugins/platforms/windows/qwindowspointerhandler.cpp +++ b/src/plugins/platforms/windows/qwindowspointerhandler.cpp @@ -564,6 +564,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 @@ -600,9 +601,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); @@ -615,7 +618,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()); |