diff options
author | Liang Qi <liang.qi@qt.io> | 2023-02-22 12:15:50 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2023-03-10 19:00:15 +0100 |
commit | 2eeefbb706d8fce8d70d454c5e9ceda3ecae2479 (patch) | |
tree | 6a96332bbbbaed5f5d18b245f4d55ab1e30281c6 /tests | |
parent | f5402747eda578079226e620e568a7174e9e28fa (diff) | |
download | qtwayland-2eeefbb706d8fce8d70d454c5e9ceda3ecae2479.tar.gz |
client: Add support for xdg_popup_configure
This amends 59a5fe99e1569421b920d99c5b20cdafcdcf43a9.
Since set_constraint_adjustment() was supported, popup should reposition
itself from configure.
Need to find a way to test clientSideMargins() and etc in the future.
Fixes: QTBUG-110623
Task-number: QTBUG-87303
Pick-to: 5.15 6.2 6.4 6.5
Done-with: Ilya Fedin <fedin-ilja2010@ya.ru>
Change-Id: I734acfcde3ba5a35b6f4222358bc93e49fa43f7c
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: David Edmundson <davidedmundson@kde.org>
Diffstat (limited to 'tests')
-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([&] { |