diff --git a/autotests/wayland/touch_input_test.cpp b/autotests/wayland/touch_input_test.cpp index 1571c2a8c9..96f98ab2c4 100644 --- a/autotests/wayland/touch_input_test.cpp +++ b/autotests/wayland/touch_input_test.cpp @@ -49,6 +49,7 @@ private Q_SLOTS: void cleanup(); void testMultipleTouchPoints(); void testCancel(); + void testTouchMouseAction(); private: AbstractClient *showWindow(); @@ -288,6 +289,34 @@ void TouchInputTest::testCancel() QCOMPARE(pointRemovedSpy.count(), 0); } +void TouchInputTest::testTouchMouseAction() +{ + // this test verifies that a touch down on an inactive client will activate it + using namespace KWayland::Client; + // create two windows + AbstractClient *c1 = showWindow(); + QVERIFY(c1); + AbstractClient *c2 = showWindow(); + QVERIFY(c2); + + QVERIFY(!c1->isActive()); + QVERIFY(c2->isActive()); + + // also create a sequence started spy as the touch event should be passed through + QSignalSpy sequenceStartedSpy(m_touch, &Touch::sequenceStarted); + QVERIFY(sequenceStartedSpy.isValid()); + + quint32 timestamp = 1; + waylandServer()->backend()->touchDown(1, c1->geometry().center(), timestamp++); + QVERIFY(c1->isActive()); + + QVERIFY(sequenceStartedSpy.wait()); + QCOMPARE(sequenceStartedSpy.count(), 1); + + // cleanup + waylandServer()->backend()->touchCancel(); +} + } WAYLANDTEST_MAIN(KWin::TouchInputTest)