Changeset View
Changeset View
Standalone View
Standalone View
autotests/integration/screenedge_client_show_test.cpp
Show First 20 Lines • Show All 80 Lines • ▼ Show 20 Line(s) | 79 | { | |||
---|---|---|---|---|---|
81 | { | 81 | { | ||
82 | xcb_disconnect(pointer); | 82 | xcb_disconnect(pointer); | ||
83 | } | 83 | } | ||
84 | }; | 84 | }; | ||
85 | 85 | | |||
86 | void ScreenEdgeClientShowTest::testScreenEdgeShowHideX11_data() | 86 | void ScreenEdgeClientShowTest::testScreenEdgeShowHideX11_data() | ||
87 | { | 87 | { | ||
88 | QTest::addColumn<QRect>("windowGeometry"); | 88 | QTest::addColumn<QRect>("windowGeometry"); | ||
89 | QTest::addColumn<QRect>("resizedWindowGeometry"); | ||||
89 | QTest::addColumn<quint32>("location"); | 90 | QTest::addColumn<quint32>("location"); | ||
90 | QTest::addColumn<QPoint>("triggerPos"); | 91 | QTest::addColumn<QPoint>("triggerPos"); | ||
91 | 92 | | |||
92 | QTest::newRow("bottom/left") << QRect(50, 1004, 1180, 20) << 2u << QPoint(100, 1023); | 93 | QTest::newRow("bottom/left") << QRect(50, 1004, 1180, 20) << QRect(150, 1004, 1000, 20) << 2u << QPoint(100, 1023); | ||
93 | QTest::newRow("bottom/right") << QRect(1330, 1004, 1180, 20) << 2u << QPoint(1400, 1023); | 94 | QTest::newRow("bottom/right") << QRect(1330, 1004, 1180, 20) << QRect(1410, 1004, 1000, 20) << 2u << QPoint(1400, 1023); | ||
94 | QTest::newRow("top/left") << QRect(50, 0, 1180, 20) << 0u << QPoint(100, 0); | 95 | QTest::newRow("top/left") << QRect(50, 0, 1180, 20) << QRect(150, 0, 1000, 20) << 0u << QPoint(100, 0); | ||
95 | QTest::newRow("top/right") << QRect(1330, 0, 1180, 20) << 0u << QPoint(1400, 0); | 96 | QTest::newRow("top/right") << QRect(1330, 0, 1180, 20) << QRect(1410, 0, 1000, 20) << 0u << QPoint(1400, 0); | ||
96 | QTest::newRow("left") << QRect(0, 10, 20, 1000) << 3u << QPoint(0, 50); | 97 | QTest::newRow("left") << QRect(0, 10, 20, 1000) << QRect(0, 70, 20, 800) << 3u << QPoint(0, 50); | ||
97 | QTest::newRow("right") << QRect(2540, 10, 20, 1000) << 1u << QPoint(2559, 60); | 98 | QTest::newRow("right") << QRect(2540, 10, 20, 1000) << QRect(2540, 70, 20, 800) << 1u << QPoint(2559, 60); | ||
98 | } | 99 | } | ||
99 | 100 | | |||
100 | void ScreenEdgeClientShowTest::testScreenEdgeShowHideX11() | 101 | void ScreenEdgeClientShowTest::testScreenEdgeShowHideX11() | ||
101 | { | 102 | { | ||
102 | // this test creates a window which borders the screen and sets the screenedge show hint | 103 | // this test creates a window which borders the screen and sets the screenedge show hint | ||
103 | // that should trigger a show of the window whenever the cursor is pushed against the screen edge | 104 | // that should trigger a show of the window whenever the cursor is pushed against the screen edge | ||
104 | 105 | | |||
105 | // create the test window | 106 | // create the test window | ||
▲ Show 20 Lines • Show All 50 Lines • ▼ Show 20 Line(s) | |||||
156 | // now trigger the edge | 157 | // now trigger the edge | ||
157 | QSignalSpy effectsWindowShownSpy(effects, &EffectsHandler::windowShown); | 158 | QSignalSpy effectsWindowShownSpy(effects, &EffectsHandler::windowShown); | ||
158 | QVERIFY(effectsWindowShownSpy.isValid()); | 159 | QVERIFY(effectsWindowShownSpy.isValid()); | ||
159 | QFETCH(QPoint, triggerPos); | 160 | QFETCH(QPoint, triggerPos); | ||
160 | Cursor::setPos(triggerPos); | 161 | Cursor::setPos(triggerPos); | ||
161 | QVERIFY(!client->isHiddenInternal()); | 162 | QVERIFY(!client->isHiddenInternal()); | ||
162 | QCOMPARE(effectsWindowShownSpy.count(), 1); | 163 | QCOMPARE(effectsWindowShownSpy.count(), 1); | ||
163 | 164 | | |||
165 | //hide window again | ||||
166 | Cursor::setPos(QPoint(640, 512)); | ||||
167 | xcb_change_property(c.data(), XCB_PROP_MODE_REPLACE, w, atom, XCB_ATOM_CARDINAL, 32, 1, &location); | ||||
168 | xcb_flush(c.data()); | ||||
169 | QVERIFY(clientHiddenSpy.wait()); | ||||
170 | QVERIFY(client->isHiddenInternal()); | ||||
171 | QFETCH(QRect, resizedWindowGeometry); | ||||
172 | //resizewhile hidden | ||||
173 | client->setGeometry(resizedWindowGeometry); | ||||
174 | //triggerPos shouldn't be valid anymore | ||||
175 | Cursor::setPos(triggerPos); | ||||
176 | QVERIFY(client->isHiddenInternal()); | ||||
177 | | ||||
164 | // destroy window again | 178 | // destroy window again | ||
165 | QSignalSpy windowClosedSpy(client, &Client::windowClosed); | 179 | QSignalSpy windowClosedSpy(client, &Client::windowClosed); | ||
166 | QVERIFY(windowClosedSpy.isValid()); | 180 | QVERIFY(windowClosedSpy.isValid()); | ||
167 | xcb_unmap_window(c.data(), w); | 181 | xcb_unmap_window(c.data(), w); | ||
168 | xcb_destroy_window(c.data(), w); | 182 | xcb_destroy_window(c.data(), w); | ||
169 | xcb_flush(c.data()); | 183 | xcb_flush(c.data()); | ||
170 | QVERIFY(windowClosedSpy.wait()); | 184 | QVERIFY(windowClosedSpy.wait()); | ||
171 | } | 185 | } | ||
172 | 186 | | |||
173 | } | 187 | } | ||
174 | 188 | | |||
175 | WAYLANDTEST_MAIN(KWin::ScreenEdgeClientShowTest) | 189 | WAYLANDTEST_MAIN(KWin::ScreenEdgeClientShowTest) | ||
176 | #include "screenedge_client_show_test.moc" | 190 | #include "screenedge_client_show_test.moc" |