summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@gmail.com>2021-08-09 19:15:31 +1000
committerLorn Potter <lorn.potter@gmail.com>2021-10-27 14:42:41 +1000
commit3d89257ce4b2480ee0c636aefd608b780a81d235 (patch)
treecb80a67572e2ffc12028ff22cbf2265afaba375c /src
parentb1820295e1e8f04634cf9c008a2473d9e2889288 (diff)
wasm: fix window activation
This fixes window activation of dialogs and tooltips In the case of tooltips, We were activating the window being removed. In the case of dialogs, we need to raise the window before requesting the activation. Change-Id: Ie989e6d92afedf1895b5e188f0695f6254d70272 Fixes: QTBUG-94918 Pick-to: 5.15 6.2 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src')
-rw-r--r--src/plugins/platforms/wasm/qwasmcompositor.cpp2
-rw-r--r--src/plugins/platforms/wasm/qwasmwindow.cpp7
-rw-r--r--src/plugins/platforms/wasm/qwasmwindow.h1
3 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/platforms/wasm/qwasmcompositor.cpp b/src/plugins/platforms/wasm/qwasmcompositor.cpp
index 385e47f0a0..f1df8b55f8 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 9b790894df..f7bc2dc4a7 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 24b56a28fc..f99c69fc79 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; }