diff options
-rw-r--r-- | src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp | 7 | ||||
-rw-r--r-- | tests/auto/client/xdgdecorationv1/tst_xdgdecorationv1.cpp | 18 |
2 files changed, 22 insertions, 3 deletions
diff --git a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp index a8e662679..56d77ec4f 100644 --- a/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp +++ b/src/plugins/shellintegration/xdg-shell/qwaylandxdgshell.cpp @@ -56,10 +56,11 @@ QWaylandXdgSurface::Toplevel::Toplevel(QWaylandXdgSurface *xdgSurface) : QtWayland::xdg_toplevel(xdgSurface->get_toplevel()) , m_xdgSurface(xdgSurface) { - if (auto *decorationManager = m_xdgSurface->m_shell->decorationManager()) - m_decoration = decorationManager->createToplevelDecoration(object()); - QWindow *window = xdgSurface->window()->window(); + if (auto *decorationManager = m_xdgSurface->m_shell->decorationManager()) { + if (!(window->flags() & Qt::FramelessWindowHint)) + m_decoration = decorationManager->createToplevelDecoration(object()); + } requestWindowStates(window->windowStates()); requestWindowFlags(window->flags()); } diff --git a/tests/auto/client/xdgdecorationv1/tst_xdgdecorationv1.cpp b/tests/auto/client/xdgdecorationv1/tst_xdgdecorationv1.cpp index 386713cf5..391abd83b 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" |