summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/windows/qwindowspointerhandler.cpp
diff options
context:
space:
mode:
authorAndré de la Rocha <andre.rocha@qt.io>2019-07-10 18:09:38 +0200
committerAndre de la Rocha <andre.rocha@qt.io>2019-07-11 20:03:01 +0200
commit786c58817187bb18552934c807ba7a7ea845f49e (patch)
tree36fdfdc040e89478afe22546a21cc990e9ddc35c /src/plugins/platforms/windows/qwindowspointerhandler.cpp
parentde8bd9ec6b21e3b43b08c4c2588b5116a7ca8ece (diff)
Windows QPA: Fix handling of mouse messages synthesized by the OS
The old handler only marked mouse events associated with mouse messages synthesized by the OS with Qt::MouseEventSynthesizedBySystem when these messages resulted from touch screen, not tablet input. Quick seems to depend on this behavior. Fixes: QTBUG-76617 Change-Id: Ib863d73ae9325f9a19d8a175817fef4e82f7df0b Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Diffstat (limited to 'src/plugins/platforms/windows/qwindowspointerhandler.cpp')
-rw-r--r--src/plugins/platforms/windows/qwindowspointerhandler.cpp11
1 files changed, 7 insertions, 4 deletions
diff --git a/src/plugins/platforms/windows/qwindowspointerhandler.cpp b/src/plugins/platforms/windows/qwindowspointerhandler.cpp
index b35629e2ce..71a09304c5 100644
--- a/src/plugins/platforms/windows/qwindowspointerhandler.cpp
+++ b/src/plugins/platforms/windows/qwindowspointerhandler.cpp
@@ -80,13 +80,12 @@ bool QWindowsPointerHandler::translatePointerEvent(QWindow *window, HWND hwnd, Q
*result = 0;
const quint32 pointerId = GET_POINTERID_WPARAM(msg.wParam);
- POINTER_INPUT_TYPE pointerType;
- if (!QWindowsContext::user32dll.getPointerType(pointerId, &pointerType)) {
+ if (!QWindowsContext::user32dll.getPointerType(pointerId, &m_pointerType)) {
qWarning() << "GetPointerType() failed:" << qt_error_string();
return false;
}
- switch (pointerType) {
+ switch (m_pointerType) {
case QT_PT_POINTER:
case QT_PT_MOUSE:
case QT_PT_TOUCHPAD: {
@@ -728,7 +727,11 @@ bool QWindowsPointerHandler::translateMouseEvent(QWindow *window,
}
Qt::MouseEventSource source = Qt::MouseEventNotSynthesized;
- if (isMouseEventSynthesizedFromPenOrTouch()) {
+ // Following the logic of the old mouse handler, only events synthesized
+ // for touch screen are marked as such. On some systems, using the bit 7 of
+ // the extra msg info for checking if synthesized for touch does not work,
+ // so we use the pointer type of the last pointer message.
+ if (isMouseEventSynthesizedFromPenOrTouch() && m_pointerType == QT_PT_TOUCH) {
if (QWindowsIntegration::instance()->options() & QWindowsIntegration::DontPassOsMouseEventsSynthesizedFromTouch)
return false;
source = Qt::MouseEventSynthesizedBySystem;