summaryrefslogtreecommitdiffstats
path: root/tests/auto/client/xdgdecorationv1/tst_xdgdecorationv1.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'tests/auto/client/xdgdecorationv1/tst_xdgdecorationv1.cpp')
-rw-r--r--tests/auto/client/xdgdecorationv1/tst_xdgdecorationv1.cpp38
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 386713cf5..e02ebeff9 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"