diff options
author | Liang Qi <liang.qi@qt.io> | 2020-04-27 08:51:53 +0200 |
---|---|---|
committer | Alexandru Croitor <alexandru.croitor@qt.io> | 2020-04-29 13:51:58 +0200 |
commit | 6319bc72e2dc63175ca797ee3042955f852e008f (patch) | |
tree | c9c1c71c43394a4cd2f0f6a75df8ba6f3a2550f3 /tests/auto/client/xdgdecorationv1/tst_xdgdecorationv1.cpp | |
parent | 00c8a79da0c80616f18329cdfc61338a2c1af7df (diff) | |
parent | 28e7d940c42c47cf039522709883ae3de9f4fb88 (diff) | |
download | qtwayland-6319bc72e2dc63175ca797ee3042955f852e008f.tar.gz |
Merge remote-tracking branch 'origin/5.15' into dev
Conflicts:
tests/auto/client/xdgoutput/tst_xdgoutput.cpp
Regenerated CMake projects.
Removed duplicate wayland source in
tests/auto/client/xdgoutput/xdgoutput.pro. It's still
referenced via the included shared.pri file. Regenerated
the CMake project to adapt to that. Otherwise the CMake
project fails to configure due to duplicate rules with
a error like the one below
CMake Error at src/compositor/Qt6WaylandCompositorMacros.cmake:13 (add_custom_command):
Attempt to add a custom rule to output
tests/auto/client/xdgoutput/wayland-xdg-output-unstable-v1-server-protocol.h.rule
Also use a workaround fix for configuring CMake standalone tests
due to regression introduced by
dd7e40b1086020f6a054957f4972720cd684 in qtbase.
Change-Id: Ib364b851a1fa828c153efbf8653c9e4ef5e618cd
Diffstat (limited to 'tests/auto/client/xdgdecorationv1/tst_xdgdecorationv1.cpp')
-rw-r--r-- | tests/auto/client/xdgdecorationv1/tst_xdgdecorationv1.cpp | 38 |
1 files changed, 38 insertions, 0 deletions
diff --git a/tests/auto/client/xdgdecorationv1/tst_xdgdecorationv1.cpp b/tests/auto/client/xdgdecorationv1/tst_xdgdecorationv1.cpp index cf20a137..98c0e044 100644 --- a/tests/auto/client/xdgdecorationv1/tst_xdgdecorationv1.cpp +++ b/tests/auto/client/xdgdecorationv1/tst_xdgdecorationv1.cpp @@ -153,6 +153,8 @@ private slots: void initTestCase(); void cleanup() { QTRY_VERIFY2(isClean(), qPrintable(dirtyMessage())); } void clientSidePreferredByCompositor(); + void initialFramelessWindowHint(); + void delayedFramelessWindowHint(); }; void tst_xdgdecorationv1::initTestCase() @@ -182,5 +184,41 @@ void tst_xdgdecorationv1::clientSidePreferredByCompositor() QTRY_VERIFY(!window.frameMargins().isNull()); } +void tst_xdgdecorationv1::initialFramelessWindowHint() +{ + QRasterWindow window; + window.setFlag(Qt::FramelessWindowHint, true); + window.show(); + QCOMPOSITOR_TRY_COMPARE(get<XdgDecorationManagerV1>()->resourceMap().size(), 1); + QCOMPOSITOR_TRY_VERIFY(xdgToplevel()); + exec([=]{ + xdgToplevel()->sendCompleteConfigure(); + }); + QCOMPOSITOR_TRY_VERIFY(xdgSurface()->m_committedConfigureSerial); + + // The client should not have create a decoration object, because that allows the compositor + // to override our decision and add server side decorations to our window. + QCOMPOSITOR_TRY_VERIFY(!toplevelDecoration()); +} + +void tst_xdgdecorationv1::delayedFramelessWindowHint() +{ + QRasterWindow window; + window.show(); + QCOMPOSITOR_TRY_COMPARE(get<XdgDecorationManagerV1>()->resourceMap().size(), 1); + QCOMPOSITOR_TRY_VERIFY(xdgToplevel()); + exec([=]{ + xdgToplevel()->sendCompleteConfigure(); + }); + QCOMPOSITOR_TRY_VERIFY(xdgSurface()->m_committedConfigureSerial); + QCOMPOSITOR_TRY_VERIFY(toplevelDecoration()); + + window.setFlag(Qt::FramelessWindowHint, true); + + // The client should now destroy the decoration object, so the compositor is no longer + // able to force window decorations + QCOMPOSITOR_TRY_VERIFY(!toplevelDecoration()); +} + QCOMPOSITOR_TEST_MAIN(tst_xdgdecorationv1) #include "tst_xdgdecorationv1.moc" |