summaryrefslogtreecommitdiffstats
path: root/src/gui/kernel/qwindow.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/gui/kernel/qwindow.cpp')
-rw-r--r--src/gui/kernel/qwindow.cpp7
1 files changed, 7 insertions, 0 deletions
diff --git a/src/gui/kernel/qwindow.cpp b/src/gui/kernel/qwindow.cpp
index 1e368914f3..5a0fc79f30 100644
--- a/src/gui/kernel/qwindow.cpp
+++ b/src/gui/kernel/qwindow.cpp
@@ -505,6 +505,8 @@ void QWindowPrivate::create(bool recursive, WId nativeHandle)
// the platformWindow, if there was one, is now gone, so make this flag reflect reality now
updateRequestPending = false;
+ const qreal currentDevicePixelRatio = q->devicePixelRatio();
+
if (q->parent())
q->parent()->create();
@@ -550,6 +552,11 @@ void QWindowPrivate::create(bool recursive, WId nativeHandle)
QPlatformSurfaceEvent e(QPlatformSurfaceEvent::SurfaceCreated);
QGuiApplication::sendEvent(q, &e);
+ if (!qFuzzyCompare(currentDevicePixelRatio, q->devicePixelRatio())) {
+ QEvent dprChangeEvent(QEvent::DevicePixelRatioChange);
+ QGuiApplication::sendEvent(q, &dprChangeEvent);
+ }
+
if (needsUpdate)
q->requestUpdate();
}