diff options
| author | Even Oscar Andersen <even.oscar.andersen@qt.io> | 2024-06-06 14:57:14 +0200 |
|---|---|---|
| committer | Even Oscar Andersen <even.oscar.andersen@qt.io> | 2024-06-13 19:33:21 +0200 |
| commit | 1b220e1db85dd332fe8c1eb8efd97dd302f9cee4 (patch) | |
| tree | e575ac93155ed5810d7bd0f0f4be34c7e04896ef /src/plugins/platforms/wasm/qwasmwindow.cpp | |
| parent | 1943183282defdbc846813e4ceb66c1eec28fec5 (diff) | |
wasm: Fix handling of native windows
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 <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmwindow.cpp')
| -rw-r--r-- | src/plugins/platforms/wasm/qwasmwindow.cpp | 10 |
1 files changed, 5 insertions, 5 deletions
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<void>("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 |
