diff options
Diffstat (limited to 'src/platformsupport/graphics/qrasterbackingstore.cpp')
-rw-r--r-- | src/platformsupport/graphics/qrasterbackingstore.cpp | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/platformsupport/graphics/qrasterbackingstore.cpp b/src/platformsupport/graphics/qrasterbackingstore.cpp index 2f7074403c..b8d393844c 100644 --- a/src/platformsupport/graphics/qrasterbackingstore.cpp +++ b/src/platformsupport/graphics/qrasterbackingstore.cpp @@ -60,7 +60,10 @@ void QRasterBackingStore::resize(const QSize &size, const QRegion &staticContent { Q_UNUSED(staticContents); - qreal nativeWindowDevicePixelRatio = window()->handle()->devicePixelRatio(); + // We can't guarantee that we have a platform-window at this point, so we have + // to pull out the DPR using QWindow and its QScreen fallback, and then remove + // the Qt scaling factor. + qreal nativeWindowDevicePixelRatio = window()->devicePixelRatio() / QHighDpiScaling::factor(window()); QSize effectiveBufferSize = size * nativeWindowDevicePixelRatio; if (m_image.size() == effectiveBufferSize) |