summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorJohan Klokkhammer Helsing <johan.helsing@qt.io>2020-02-11 14:28:32 +0100
committerJohan Klokkhammer Helsing <johan.helsing@qt.io>2020-02-13 09:03:00 +0100
commite21230a3b8b4aca50121c373a6ffea770807d4a0 (patch)
treea8f58a963f3949254bae82a631059b9d08b9d7aa /tests
parent1ef3ec8cae1f27a15b131f82d6401fd6bb79c9fa (diff)
downloadqtwayland-e21230a3b8b4aca50121c373a6ffea770807d4a0.tar.gz
Client: Don't allow decorations for frameless windows
This only fixes it for when Qt::FramelessWindowHint is set appropriately before the window is shown. [ChangeLog][QPA plugin] Windows with Qt::FramelessWindowHint no longer create zxdg_toplevel_decoration_v1, as that allowed compositors to force server-side decorations. Fixes: QTBUG-80702 Change-Id: I47a582a59f6682a57128c0c9d4e4b9a6181925a4 Reviewed-by: Pier Luigi Fiorini <pierluigi.fiorini@liri.io>
Diffstat (limited to 'tests')
-rw-r--r--tests/auto/client/xdgdecorationv1/tst_xdgdecorationv1.cpp18
1 files changed, 18 insertions, 0 deletions
diff --git a/tests/auto/client/xdgdecorationv1/tst_xdgdecorationv1.cpp b/tests/auto/client/xdgdecorationv1/tst_xdgdecorationv1.cpp
index 386713cf..391abd83 100644
--- a/tests/auto/client/xdgdecorationv1/tst_xdgdecorationv1.cpp
+++ b/tests/auto/client/xdgdecorationv1/tst_xdgdecorationv1.cpp
@@ -153,6 +153,7 @@ private slots:
void initTestCase();
void cleanup() { QTRY_VERIFY2(isClean(), qPrintable(dirtyMessage())); }
void clientSidePreferredByCompositor();
+ void initialFramelessWindowHint();
};
void tst_xdgdecorationv1::initTestCase()
@@ -182,5 +183,22 @@ 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());
+}
+
QCOMPOSITOR_TEST_MAIN(tst_xdgdecorationv1)
#include "tst_xdgdecorationv1.moc"