From 11f12521bcd9c76f0ff5c60fb8785aba33ec7ca7 Mon Sep 17 00:00:00 2001 From: Mikolaj Boc Date: Tue, 23 Aug 2022 14:24:36 +0200 Subject: Resolve window focusing problems on WASM MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - Moved the modal window resolution to QWasmWindow::requestActivateWindow so that multiple async activation events are not issued in unpredictable patterns. - Request activation on added windows and on stack top in case of window removal Pick-to: 6.4 Change-Id: I6f02cf1b7e83abb7961caf311ffc83e91c8bf810 Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/wasm/qwasmwindowstack.cpp | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'src/plugins/platforms/wasm/qwasmwindowstack.cpp') diff --git a/src/plugins/platforms/wasm/qwasmwindowstack.cpp b/src/plugins/platforms/wasm/qwasmwindowstack.cpp index 9ce6689c8d3..cc1a3cad6af 100644 --- a/src/plugins/platforms/wasm/qwasmwindowstack.cpp +++ b/src/plugins/platforms/wasm/qwasmwindowstack.cpp @@ -18,7 +18,7 @@ void QWasmWasmWindowStack::pushWindow(QWasmWindow *window) m_windowStack.push_back(window); - m_topWindowChangedCallback(window); + m_topWindowChangedCallback(); } void QWasmWasmWindowStack::removeWindow(QWasmWindow *window) @@ -34,7 +34,7 @@ void QWasmWasmWindowStack::removeWindow(QWasmWindow *window) m_windowStack.erase(it); if (removingTop) - m_topWindowChangedCallback(topWindow()); + m_topWindowChangedCallback(); } void QWasmWasmWindowStack::raise(QWasmWindow *window) @@ -46,7 +46,7 @@ void QWasmWasmWindowStack::raise(QWasmWindow *window) auto it = std::find(regularWindowsBegin(), m_windowStack.end(), window); std::rotate(it, it + 1, m_windowStack.end()); - m_topWindowChangedCallback(topWindow()); + m_topWindowChangedCallback(); } void QWasmWasmWindowStack::lower(QWasmWindow *window) @@ -60,7 +60,7 @@ void QWasmWasmWindowStack::lower(QWasmWindow *window) auto it = std::find(regularWindowsBegin(), m_windowStack.end(), window); std::rotate(regularWindowsBegin(), it, it + 1); if (loweringTopWindow && topWindow() != window) - m_topWindowChangedCallback(topWindow()); + m_topWindowChangedCallback(); } QWasmWasmWindowStack::iterator QWasmWasmWindowStack::begin() -- cgit v1.2.3