From 1b220e1db85dd332fe8c1eb8efd97dd302f9cee4 Mon Sep 17 00:00:00 2001 From: Even Oscar Andersen Date: Thu, 6 Jun 2024 14:57:14 +0200 Subject: wasm: Fix handling of native windows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit There are two problems 1) internal (not toplevel) windows needs to have the frameLess attribute set. Without this attribute the window is not visible 2) The backingstore needs to use the correct window, if not the symptoms are that the display is not always correctly updated. Seen in the qtdoc/examples/demos/documentviewer demo Fixes: QTBUG-125856 Change-Id: I040d963c0c130214cc70a607090faa006c02f981 Reviewed-by: Morten Johan Sørvig --- src/plugins/platforms/wasm/qwasmwindow.cpp | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/plugins/platforms/wasm/qwasmwindow.cpp') diff --git a/src/plugins/platforms/wasm/qwasmwindow.cpp b/src/plugins/platforms/wasm/qwasmwindow.cpp index 99e9bb22f1b..6fa56f1d064 100644 --- a/src/plugins/platforms/wasm/qwasmwindow.cpp +++ b/src/plugins/platforms/wasm/qwasmwindow.cpp @@ -317,7 +317,7 @@ void QWasmWindow::setGeometry(const QRect &rect) if (shouldInvalidate) invalidate(); else - m_compositor->requestUpdateWindow(this); + m_compositor->requestUpdateWindow(this, QRect(QPoint(0, 0), geometry().size())); } void QWasmWindow::setVisible(bool visible) @@ -327,7 +327,7 @@ void QWasmWindow::setVisible(bool visible) if (visible == nowVisible) return; - m_compositor->requestUpdateWindow(this, QWasmCompositor::ExposeEventDelivery); + m_compositor->requestUpdateWindow(this, QRect(QPoint(0, 0), geometry().size()), QWasmCompositor::ExposeEventDelivery); m_qtWindow["style"].set("display", visible ? "block" : "none"); if (window()->isActive()) m_canvas.call("focus"); @@ -385,7 +385,7 @@ void QWasmWindow::setOpacity(qreal level) void QWasmWindow::invalidate() { - m_compositor->requestUpdateWindow(this); + m_compositor->requestUpdateWindow(this, QRect(QPoint(0, 0), geometry().size())); } void QWasmWindow::onActivationChanged(bool active) @@ -401,7 +401,7 @@ void QWasmWindow::setWindowFlags(Qt::WindowFlags flags) onPositionPreferenceChanged(positionPreferenceFromWindowFlags(flags)); } m_flags = flags; - dom::syncCSSClassWith(m_qtWindow, "frameless", !hasFrame()); + dom::syncCSSClassWith(m_qtWindow, "frameless", !hasFrame() || !window()->isTopLevel()); dom::syncCSSClassWith(m_qtWindow, "has-border", hasBorder()); dom::syncCSSClassWith(m_qtWindow, "has-shadow", hasShadow()); dom::syncCSSClassWith(m_qtWindow, "has-title", hasTitleBar()); @@ -566,7 +566,7 @@ qreal QWasmWindow::devicePixelRatio() const void QWasmWindow::requestUpdate() { - m_compositor->requestUpdateWindow(this, QWasmCompositor::UpdateRequestDelivery); + m_compositor->requestUpdateWindow(this, QRect(QPoint(0, 0), geometry().size()), QWasmCompositor::UpdateRequestDelivery); } bool QWasmWindow::hasFrame() const -- cgit v1.2.3