From 1d612c5100a02d3d4f9b1caba3489e76ef6a81fe Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Morten=20S=C3=B8rvig?= Date: Fri, 7 Jun 2024 13:00:30 +0200 Subject: [PATCH] wasm: don't make normal-state windows StaysOnBottom Setting StaysOnBottom creates a special case where the first window is always kept at the bottom of the window stack. However this becomes confusing if the first window is not maximized or fullscreen, since it's then not possible to bring it to front by clicking the title bar. Add a check on the window state, and set WindowStaysOnBottomHint for maximized or fullscreen windows only. Pick-to: 6.8 Change-Id: I0f43874cfcdc7c951c47cd278f5acdd42368cd5a Reviewed-by: Lorn Potter --- src/plugins/platforms/wasm/qwasmscreen.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/wasm/qwasmscreen.cpp b/src/plugins/platforms/wasm/qwasmscreen.cpp index 0490b2bfe08..35a95a2131c 100644 --- a/src/plugins/platforms/wasm/qwasmscreen.cpp +++ b/src/plugins/platforms/wasm/qwasmscreen.cpp @@ -266,9 +266,13 @@ void QWasmScreen::onSubtreeChanged(QWasmWindowTreeNodeChangeType changeType, QWasmWindowTreeNode *parent, QWasmWindow *child) { Q_UNUSED(parent); + + QWindow *window = child->window(); + const bool isMaxFull = (window->windowState() & Qt::WindowMaximized) || + (window->windowState() & Qt::WindowFullScreen); if (changeType == QWasmWindowTreeNodeChangeType::NodeInsertion && parent == this - && childStack().size() == 1) { - child->window()->setFlag(Qt::WindowStaysOnBottomHint); + && childStack().size() == 1 && isMaxFull) { + window->setFlag(Qt::WindowStaysOnBottomHint); } QWasmWindowTreeNode::onSubtreeChanged(changeType, parent, child); m_compositor->onWindowTreeChanged(changeType, child);