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>
bb10
Lorn Potter 2021-05-20 15:57:30 +10:00
parent 8c9fef0473
commit a89754a2f3
1 changed files with 9 additions and 1 deletions

View File

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