diff options
Diffstat (limited to 'tests/auto/client/xdgshell/tst_xdgshell.cpp')
-rw-r--r-- | tests/auto/client/xdgshell/tst_xdgshell.cpp | 22 |
1 files changed, 20 insertions, 2 deletions
diff --git a/tests/auto/client/xdgshell/tst_xdgshell.cpp b/tests/auto/client/xdgshell/tst_xdgshell.cpp index 101baecc..82fb50e3 100644 --- a/tests/auto/client/xdgshell/tst_xdgshell.cpp +++ b/tests/auto/client/xdgshell/tst_xdgshell.cpp @@ -13,6 +13,7 @@ class tst_xdgshell : public QObject, private DefaultCompositor { Q_OBJECT private slots: + void init(); void cleanup() { QTRY_VERIFY2(isClean(), qPrintable(dirtyMessage())); } void showMinimized(); void basicConfigure(); @@ -31,6 +32,11 @@ private slots: void nativeResources(); }; +void tst_xdgshell::init() +{ + setenv("QT_WAYLAND_DISABLE_WINDOWDECORATION", "1", 1); +} + void tst_xdgshell::showMinimized() { // On xdg-shell there's really no way for the compositor to tell the window if it's minimized @@ -239,8 +245,8 @@ void tst_xdgshell::popup() QRasterWindow *popup = window.m_popup.get(); QVERIFY(!popup->isExposed()); // wait for configure - //TODO: Verify it works with a different configure window geometry - exec([=] { xdgPopup()->sendConfigure(QRect(100, 100, 100, 100)); }); + QRect rect1 = QRect(100, 100, 100, 100); + exec([=] { xdgPopup()->sendConfigure(rect1); }); // Nothing should happen before the *xdg_surface* configure QTRY_VERIFY(!popup->isExposed()); // Popup shouldn't be exposed before the first configure event @@ -256,6 +262,18 @@ void tst_xdgshell::popup() // The client is now going to ack the configure QTRY_COMPARE(popupConfigureSpy.size(), 1); QCOMPARE(popupConfigureSpy.takeFirst().at(0).toUInt(), configureSerial); + QCOMPARE(popup->geometry(), rect1); + + QRect rect2 = QRect(50, 50, 150, 150); + exec([=] { xdgPopup()->sendConfigure(rect2); }); + + const uint configureSerial2 = exec([=] { + return xdgPopup()->m_xdgSurface->sendConfigure(); + }); + + QTRY_COMPARE(popupConfigureSpy.size(), 1); + QCOMPARE(popupConfigureSpy.takeFirst().at(0).toUInt(), configureSerial2); + QCOMPARE(popup->geometry(), rect2); // And attach a buffer exec([&] { |