diff options
| author | Morten Sørvig <morten.sorvig@qt.io> | 2024-03-01 19:28:40 +0100 |
|---|---|---|
| committer | Morten Johan Sørvig <morten.sorvig@qt.io> | 2024-03-08 15:12:44 +0000 |
| commit | b8584173ab6a3fc4e034bc237b34f4968528b0f3 (patch) | |
| tree | e70271e5e8e276bf08ed451a0f36e99dbd4f06ba /src/plugins/platforms/wasm/qwasmcompositor.cpp | |
| parent | 419a1844afdee8deabb3648821d4e1b47e15233d (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.
Pick-to: 6.6 6.7
Change-Id: Ica7a24a458b3b01f1c7b2e1e09d342114dc71331
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
Diffstat (limited to 'src/plugins/platforms/wasm/qwasmcompositor.cpp')
| -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 ebc59a567c1..ef460f666ff 100644 --- a/src/plugins/platforms/wasm/qwasmcompositor.cpp +++ b/src/plugins/platforms/wasm/qwasmcompositor.cpp @@ -116,11 +116,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) |
