@@ -45,6 +45,7 @@ private Q_SLOTS:
4545 void releaseAndPressRecognisedGestureDoesNotRejectForPeriod();
4646 void topAreaReceivesOwnershipFirstWithEqualPoints();
4747 void topAreaReceivesOwnershipFirstWithMorePoints();
48+ void newTouchAfterRejectionIsPassedThrough();
4849
4950private:
5051 void initGestureComponent(TouchGestureArea *area);
@@ -265,6 +266,35 @@ void tst_TouchGestureArea::topAreaReceivesOwnershipFirstWithMorePoints()
265266 QCOMPARE((int)m_gestureMiddle->status(), (int)TouchGestureArea::Rejected);
266267}
267268
269+void tst_TouchGestureArea::newTouchAfterRejectionIsPassedThrough() {
270+ m_gestureTop->setEnabled(true);
271+ m_gestureTop->setMinimumTouchPoints(2);
272+ m_gestureTop->setMaximumTouchPoints(2);
273+ m_gestureTop->setRecognitionPeriod(30);
274+
275+ m_gestureBottom->setEnabled(true);
276+ m_gestureBottom->setMinimumTouchPoints(2);
277+ m_gestureBottom->setMaximumTouchPoints(2);
278+ m_gestureBottom->setRecognitionPeriod(50);
279+
280+ QPointF touchPoint = calculateInitialTouchPos(m_gestureBottom);
281+
282+ QTest::touchEvent(m_view, m_device).press(0, touchPoint.toPoint());
283+ QCOMPARE((int)m_gestureTop->status(), (int)TouchGestureArea::Undecided);
284+ QCOMPARE((int)m_gestureBottom->status(), (int)TouchGestureArea::Undecided);
285+
286+ passTime(40); // 10ms after top item's recognition period.
287+ QCOMPARE((int)m_gestureTop->status(), (int)TouchGestureArea::Rejected);
288+ QCOMPARE((int)m_gestureBottom->status(), (int)TouchGestureArea::Undecided);
289+
290+ // If the top item passes the event down the line, now the bottom one will
291+ // recognize the gesture.
292+ QTest::touchEvent(m_view, m_device).stationary(0)
293+ .press(1, touchPoint.toPoint());
294+ QCOMPARE((int)m_gestureTop->status(), (int)TouchGestureArea::Rejected);
295+ QCOMPARE((int)m_gestureBottom->status(), (int)TouchGestureArea::Recognized);
296+}
297+
268298QTEST_MAIN(tst_TouchGestureArea)
269299
270300#include "tst_TouchGestureArea.moc"