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.

Change-Id: I0f43874cfcdc7c951c47cd278f5acdd42368cd5a
Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
(cherry picked from commit 1d612c5100a02d3d4f9b1caba3489e76ef6a81fe)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
This commit is contained in:
Morten Sørvig 2024-06-07 13:00:30 +02:00 committed by Qt Cherry-pick Bot
parent 260685d1ee
commit 30786c02d9

View File

@ -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);