Windows QPA: Fix touch message queue handling
In the handling of pointer messages for touchscreen we use a queue that is flushed when mouse messages synthesized by Windows are received. However, these fake mouse messages should be otherwise ignored. Their handling was causing issues with PointHandler in QtQuick. This change fixes the part of QTBUG-71431 that causes a single touch drag to behave unexpectedly with PointHandler. Task-number: QTBUG-71431 Change-Id: Iccdd554876f411bce2dd1f922a3d889e61b7bb1c Reviewed-by: Miguel Costa <miguel.costa@qt.io>
This commit is contained in:
parent
9c325e0a3c
commit
bc997b856a
@ -641,6 +641,7 @@ bool QWindowsPointerHandler::translateTouchEvent(QWindow *window, HWND hwnd,
|
||||
// Only the primary pointer will generate mouse messages.
|
||||
enqueueTouchEvent(window, touchPoints, QWindowsKeyMapper::queryKeyboardModifiers());
|
||||
} else {
|
||||
flushTouchEvents(m_touchDevice);
|
||||
QWindowSystemInterface::handleTouchEvent(window, m_touchDevice, touchPoints,
|
||||
QWindowsKeyMapper::queryKeyboardModifiers());
|
||||
}
|
||||
@ -766,6 +767,13 @@ bool QWindowsPointerHandler::translateMouseEvent(QWindow *window, HWND hwnd, QtW
|
||||
if (et != QtWindows::MouseWheelEvent && msg.message != WM_MOUSELEAVE && msg.message != WM_MOUSEMOVE)
|
||||
return false;
|
||||
|
||||
// Ignore messages synthesized from touch/pen (only use them for flushing queues).
|
||||
const quint64 signatureMask = 0xffffff00;
|
||||
const quint64 miWpSignature = 0xff515700;
|
||||
const quint64 extraInfo = quint64(GetMessageExtraInfo());
|
||||
if ((extraInfo & signatureMask) == miWpSignature)
|
||||
return false;
|
||||
|
||||
const QPoint eventPos(GET_X_LPARAM(msg.lParam), GET_Y_LPARAM(msg.lParam));
|
||||
QPoint localPos;
|
||||
QPoint globalPos;
|
||||
|
Loading…
x
Reference in New Issue
Block a user