Clear touch ids when canceling a touch sequence

Before calling touchUp would hit an abort in KWayland::Server.
This commit is contained in:
Martin Gräßlin 2016-02-09 14:50:30 +01:00
parent d02c325a61
commit 142e826191
2 changed files with 7 additions and 0 deletions

View file

@ -270,6 +270,8 @@ void TouchInputTest::testCancel()
QVERIFY(sequenceStartedSpy.isValid());
QSignalSpy cancelSpy(m_touch, &Touch::sequenceCanceled);
QVERIFY(cancelSpy.isValid());
QSignalSpy pointRemovedSpy(m_touch, &Touch::pointRemoved);
QVERIFY(pointRemovedSpy.isValid());
quint32 timestamp = 1;
waylandServer()->backend()->touchDown(1, QPointF(125, 125), timestamp++);
@ -280,6 +282,10 @@ void TouchInputTest::testCancel()
waylandServer()->backend()->touchCancel();
QVERIFY(cancelSpy.wait());
QCOMPARE(cancelSpy.count(), 1);
waylandServer()->backend()->touchUp(1, timestamp++);
QVERIFY(!pointRemovedSpy.wait(100));
QCOMPARE(pointRemovedSpy.count(), 0);
}
}

View file

@ -1397,6 +1397,7 @@ void InputRedirection::cancelTouch()
if (auto seat = findSeat()) {
seat->cancelTouchSequence();
}
m_touchIdMapper.clear();
}
void InputRedirection::touchFrame()