From e5743ee7db2411206827f98fae34f73890b74ab9 Mon Sep 17 00:00:00 2001 From: Mikolaj Boc Date: Fri, 5 Aug 2022 10:58:51 +0200 Subject: [PATCH] Only manually expose the wasm window on raise/lower if it is visible MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit If the window is manually exposed and the window is invisible, the result is blocking the visual sync and repainting of the window, which makes the window 'dead' from user perspective until they click/activate it, which again sends an expose event to the window, restoring its updates. Fixes: QTBUG-105363 Change-Id: Iaa42f3ffeca179b8e6da19c9c02a6f01458ca66a Reviewed-by: Lorn Potter (cherry picked from commit 5a76837a7f4134454de65547043b78d51e3d7bef) Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/wasm/qwasmwindow.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/plugins/platforms/wasm/qwasmwindow.cpp b/src/plugins/platforms/wasm/qwasmwindow.cpp index 31e6ead6ade..6f9ca52d66f 100644 --- a/src/plugins/platforms/wasm/qwasmwindow.cpp +++ b/src/plugins/platforms/wasm/qwasmwindow.cpp @@ -125,14 +125,16 @@ QMargins QWasmWindow::frameMargins() const void QWasmWindow::raise() { m_compositor->raise(this); - QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), geometry().size())); + if (window()->isVisible()) + QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), geometry().size())); invalidate(); } void QWasmWindow::lower() { m_compositor->lower(this); - QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), geometry().size())); + if (window()->isVisible()) + QWindowSystemInterface::handleExposeEvent(window(), QRect(QPoint(0, 0), geometry().size())); invalidate(); }