diff --git a/src/plugins/platforms/wasm/qwasmcompositor.cpp b/src/plugins/platforms/wasm/qwasmcompositor.cpp index 385e47f0a01..f1df8b55f87 100644 --- a/src/plugins/platforms/wasm/qwasmcompositor.cpp +++ b/src/plugins/platforms/wasm/qwasmcompositor.cpp @@ -131,8 +131,8 @@ void QWasmCompositor::removeWindow(QWasmWindow *window) if (!m_windowStack.isEmpty() && !QGuiApplication::focusWindow()) { auto lastWindow = m_windowStack.last(); lastWindow->requestActivateWindow(); + notifyTopWindowChanged(lastWindow); } - notifyTopWindowChanged(window); } void QWasmCompositor::setVisible(QWasmWindow *window, bool visible) diff --git a/src/plugins/platforms/wasm/qwasmwindow.cpp b/src/plugins/platforms/wasm/qwasmwindow.cpp index 9b790894df5..f7bc2dc4a78 100644 --- a/src/plugins/platforms/wasm/qwasmwindow.cpp +++ b/src/plugins/platforms/wasm/qwasmwindow.cpp @@ -423,4 +423,11 @@ bool QWasmWindow::windowIsPopupType(Qt::WindowType type) const return false; } +void QWasmWindow::requestActivateWindow() +{ + if (window()->isTopLevel()) + raise(); + QPlatformWindow::requestActivateWindow(); +} + QT_END_NAMESPACE diff --git a/src/plugins/platforms/wasm/qwasmwindow.h b/src/plugins/platforms/wasm/qwasmwindow.h index 24b56a28fc1..f99c69fc799 100644 --- a/src/plugins/platforms/wasm/qwasmwindow.h +++ b/src/plugins/platforms/wasm/qwasmwindow.h @@ -74,6 +74,7 @@ public: QRect normalGeometry() const override; qreal devicePixelRatio() const override; void requestUpdate() override; + void requestActivateWindow() override; QWasmScreen *platformScreen() const; void setBackingStore(QWasmBackingStore *store) { m_backingStore = store; }