diff options
author | Morten Sørvig <morten.sorvig@qt.io> | 2024-03-01 19:28:40 +0100 |
---|---|---|
committer | Qt Cherry-pick Bot <cherrypick_bot@qt-project.org> | 2024-03-08 20:51:23 +0000 |
commit | e929e8a6fbc928717746d0a492bbf10a447c49d6 (patch) | |
tree | 12fd6fdc7a75b69bb83f09a557c489d4447f37fd | |
parent | a86cd4dbeeacc42f095db5ada0f0ea59f390465c (diff) |
wasm: send DPR change event on window update
Qt Gui expects that the platform sends DPR update
notifications if the DPR value has changed, before
sending expose/paint events or delivering update
request events.
The most straightforward implementation is to send
the DPR update event unconditionally and let Qt Gui
determine if the DPR value has changed, especially
if the native platform does not provide DPR change
events.
Change-Id: Ica7a24a458b3b01f1c7b2e1e09d342114dc71331
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
(cherry picked from commit b8584173ab6a3fc4e034bc237b34f4968528b0f3)
Reviewed-by: Qt Cherry-pick Bot <cherrypick_bot@qt-project.org>
(cherry picked from commit 4f8d01b43669a82533a93df44fcd76b10e01f955)
-rw-r--r-- | src/plugins/platforms/wasm/qwasmcompositor.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/plugins/platforms/wasm/qwasmcompositor.cpp b/src/plugins/platforms/wasm/qwasmcompositor.cpp index 92e3150738..fc3cbcaa8f 100644 --- a/src/plugins/platforms/wasm/qwasmcompositor.cpp +++ b/src/plugins/platforms/wasm/qwasmcompositor.cpp @@ -172,11 +172,16 @@ void QWasmCompositor::deliverUpdateRequests() void QWasmCompositor::deliverUpdateRequest(QWasmWindow *window, UpdateRequestDeliveryType updateType) { + QWindow *qwindow = window->window(); + + // Make sure the DPR value for the window is up to date on expose/repaint. + // FIXME: listen to native DPR change events instead, if/when available. + QWindowSystemInterface::handleWindowDevicePixelRatioChanged(qwindow); + // Update by deliverUpdateRequest and expose event according to requested update // type. If the window has not yet been exposed then we must expose it first regardless // of update type. The deliverUpdateRequest must still be sent in this case in order // to maintain correct window update state. - QWindow *qwindow = window->window(); QRect updateRect(QPoint(0, 0), qwindow->geometry().size()); if (updateType == UpdateRequestDelivery) { if (qwindow->isExposed() == false) |