|
| 1 | +Index: qtbase-opensource-src/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp |
| 2 | +=================================================================== |
| 3 | +--- qtbase-opensource-src.orig/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp |
| 4 | ++++ qtbase-opensource-src/src/plugins/platforms/xcb/qxcbconnection_xi2.cpp |
| 5 | +@@ -591,8 +591,12 @@ void QXcbConnection::xi2HandleEvent(xcb_ |
| 6 | + event->event_type, xiDeviceEvent->sequence, xiDeviceEvent->detail, |
| 7 | + fixed1616ToReal(xiDeviceEvent->event_x), fixed1616ToReal(xiDeviceEvent->event_y), |
| 8 | + fixed1616ToReal(xiDeviceEvent->root_x), fixed1616ToReal(xiDeviceEvent->root_y),xiDeviceEvent->event); |
| 9 | +- if (QXcbWindow *platformWindow = platformWindowFromId(xiDeviceEvent->event)) |
| 10 | ++ if (QXcbWindow *platformWindow = platformWindowFromId(xiDeviceEvent->event)) { |
| 11 | + xi2ProcessTouch(xiDeviceEvent, platformWindow); |
| 12 | ++ } else { // When the window cannot be matched, delete it from touchPoints |
| 13 | ++ if (TouchDeviceData *dev = touchDeviceForId(xiDeviceEvent->sourceid)) |
| 14 | ++ dev->touchPoints.remove((xiDeviceEvent->detail % INT_MAX)); |
| 15 | ++ } |
| 16 | + break; |
| 17 | + } |
| 18 | + } else if (xiEnterEvent && !xi2MouseEventsDisabled() && eventListener) { |
| 19 | +Index: qtbase-opensource-src/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp |
| 20 | +=================================================================== |
| 21 | +--- qtbase-opensource-src.orig/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp |
| 22 | ++++ qtbase-opensource-src/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp |
| 23 | +@@ -1113,8 +1113,9 @@ void tst_QWindow::touchToMouseTranslatio |
| 24 | + QVERIFY(QTest::qWaitForWindowExposed(&window)); |
| 25 | + |
| 26 | + QList<QWindowSystemInterface::TouchPoint> points; |
| 27 | +- QWindowSystemInterface::TouchPoint tp1, tp2; |
| 28 | ++ QWindowSystemInterface::TouchPoint tp1, tp2, tp3; |
| 29 | + const QRectF pressArea(101, 102, 4, 4); |
| 30 | ++ const QRectF pressArea1(107, 110, 4, 4); |
| 31 | + const QRectF moveArea(105, 108, 4, 4); |
| 32 | + tp1.id = 1; |
| 33 | + tp1.state = Qt::TouchPointPressed; |
| 34 | +@@ -1122,6 +1123,9 @@ void tst_QWindow::touchToMouseTranslatio |
| 35 | + tp2.id = 2; |
| 36 | + tp2.state = Qt::TouchPointPressed; |
| 37 | + points << tp1 << tp2; |
| 38 | ++ tp3.id = 3; |
| 39 | ++ tp3.state = Qt::TouchPointPressed; |
| 40 | ++ tp3.area = QHighDpi::toNativePixels(pressArea1, &window); |
| 41 | + QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); |
| 42 | + // Now an update but with changed list order. The mouse event should still |
| 43 | + // be generated from the point with id 1. |
| 44 | +@@ -1194,6 +1198,40 @@ void tst_QWindow::touchToMouseTranslatio |
| 45 | + points[0].state = Qt::TouchPointReleased; |
| 46 | + QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); |
| 47 | + QCoreApplication::processEvents(); |
| 48 | ++ points.clear(); |
| 49 | ++ points.append(tp1); |
| 50 | ++ points[0].state = Qt::TouchPointReleased; |
| 51 | ++ QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); |
| 52 | ++ QCoreApplication::processEvents(); |
| 53 | ++ QTRY_COMPARE(window.mouseReleaseButton, 1); |
| 54 | ++ |
| 55 | ++ points.clear(); |
| 56 | ++ points.append(tp1); |
| 57 | ++ points[0].state = Qt::TouchPointPressed; |
| 58 | ++ QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); |
| 59 | ++ QCoreApplication::processEvents(); |
| 60 | ++ points.clear(); |
| 61 | ++ points.append(tp2); |
| 62 | ++ points[0].state = Qt::TouchPointPressed; |
| 63 | ++ QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); |
| 64 | ++ QCoreApplication::processEvents(); |
| 65 | ++ points.clear(); |
| 66 | ++ points.append(tp3); |
| 67 | ++ points[0].state = Qt::TouchPointPressed; |
| 68 | ++ QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); |
| 69 | ++ QCoreApplication::processEvents(); |
| 70 | ++ QTRY_COMPARE(window.mousePressButton, 1); |
| 71 | ++ |
| 72 | ++ points.clear(); |
| 73 | ++ points.append(tp2); |
| 74 | ++ points[0].state = Qt::TouchPointReleased; |
| 75 | ++ QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); |
| 76 | ++ QCoreApplication::processEvents(); |
| 77 | ++ points.clear(); |
| 78 | ++ points.append(tp3); |
| 79 | ++ points[0].state = Qt::TouchPointReleased; |
| 80 | ++ QWindowSystemInterface::handleTouchEvent(&window, touchDevice, points); |
| 81 | ++ QCoreApplication::processEvents(); |
| 82 | + points.clear(); |
| 83 | + points.append(tp1); |
| 84 | + points[0].state = Qt::TouchPointReleased; |
| 85 | +Index: qtbase-opensource-src/tests/auto/widgets/kernel/qgesturerecognizer/tst_qgesturerecognizer.cpp |
| 86 | +=================================================================== |
| 87 | +--- qtbase-opensource-src.orig/tests/auto/widgets/kernel/qgesturerecognizer/tst_qgesturerecognizer.cpp |
| 88 | ++++ qtbase-opensource-src/tests/auto/widgets/kernel/qgesturerecognizer/tst_qgesturerecognizer.cpp |
| 89 | +@@ -297,7 +297,7 @@ void tst_QGestureRecognizer::swipeGestur |
| 90 | + |
| 91 | + // Press point #3 |
| 92 | + points.append(points.last() + fingerDistance); |
| 93 | +- swipeSequence.press(points.size() - 1, points.last(), &widget); |
| 94 | ++ swipeSequence.stationary(0).stationary(1).press(points.size() - 1, points.last(), &widget); |
| 95 | + swipeSequence.commit(); |
| 96 | + Q_ASSERT(points.size() == swipePoints); |
| 97 | + |
| 98 | +Index: qtbase-opensource-src/src/gui/kernel/qguiapplication.cpp |
| 99 | +=================================================================== |
| 100 | +--- qtbase-opensource-src.orig/src/gui/kernel/qguiapplication.cpp |
| 101 | ++++ qtbase-opensource-src/src/gui/kernel/qguiapplication.cpp |
| 102 | +@@ -3064,7 +3064,7 @@ void QGuiApplicationPrivate::processTouc |
| 103 | + QEvent::Type mouseEventType = QEvent::MouseMove; |
| 104 | + Qt::MouseButton button = Qt::NoButton; |
| 105 | + Qt::MouseButtons buttons = Qt::LeftButton; |
| 106 | +- if (eventType == QEvent::TouchBegin && m_fakeMouseSourcePointId < 0) |
| 107 | ++ if (eventType == QEvent::TouchBegin || m_fakeMouseSourcePointId < 0) |
| 108 | + m_fakeMouseSourcePointId = touchPoints.first().id(); |
| 109 | + for (const auto &touchPoint : touchPoints) { |
| 110 | + if (touchPoint.id() == m_fakeMouseSourcePointId) { |
0 commit comments