summaryrefslogtreecommitdiffstats
path: root/src/plugins
diff options
context:
space:
mode:
authorLorn Potter <lorn.potter@gmail.com>2021-05-20 15:57:30 +1000
committerLorn Potter <lorn.potter@gmail.com>2021-05-21 21:26:51 +0000
commita89754a2f322576d6d780976888ca517f48c26c3 (patch)
tree20b4ca4d2f190785afc96c00f1043e9867adfae2 /src/plugins
parent8c9fef04736a083e74ff78a7806729bc614a9e60 (diff)
wasm: fix tooltips show/hide behavior
When tool tip was trying to show its window became activated causing tool tip to hide instantly due to a redundant window activation bug on show/hide/raise/lower. Fixes: QTBUG-91095 Change-Id: Id215400a79cdc4ed1961731949ca139b575eec88 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins')
-rw-r--r--src/plugins/platforms/wasm/qwasmcompositor.cpp10
1 files changed, 9 insertions, 1 deletions
diff --git a/src/plugins/platforms/wasm/qwasmcompositor.cpp b/src/plugins/platforms/wasm/qwasmcompositor.cpp
index 9a16ae7719..3883bf3c95 100644
--- a/src/plugins/platforms/wasm/qwasmcompositor.cpp
+++ b/src/plugins/platforms/wasm/qwasmcompositor.cpp
@@ -110,6 +110,9 @@ void QWasmCompositor::addWindow(QWasmWindow *window, QWasmWindow *parentWindow)
else
m_compositedWindows[parentWindow].childWindows.append(window);
+ if (!QGuiApplication::focusWindow()) {
+ window->requestActivateWindow();
+ }
notifyTopWindowChanged(window);
}
@@ -125,6 +128,10 @@ void QWasmCompositor::removeWindow(QWasmWindow *window)
m_windowStack.removeAll(window);
m_compositedWindows.remove(window);
+ if (!m_windowStack.isEmpty() && !QGuiApplication::focusWindow()) {
+ auto lastWindow = m_windowStack.last();
+ lastWindow->requestActivateWindow();
+ }
notifyTopWindowChanged(window);
}
@@ -734,12 +741,13 @@ void QWasmCompositor::notifyTopWindowChanged(QWasmWindow *window)
bool blocked = QGuiApplicationPrivate::instance()->isWindowBlocked(window->window(), &modalWindow);
if (blocked) {
+ modalWindow->requestActivate();
raise(static_cast<QWasmWindow*>(modalWindow->handle()));
return;
}
requestRedraw();
- QWindowSystemInterface::handleWindowActivated(window->window());
+
}
QWasmScreen *QWasmCompositor::screen()