diff options
Diffstat (limited to 'src/gui/kernel/qplatformintegration.cpp')
-rw-r--r-- | src/gui/kernel/qplatformintegration.cpp | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/src/gui/kernel/qplatformintegration.cpp b/src/gui/kernel/qplatformintegration.cpp index 7d1fcd4eeb..bb20a160db 100644 --- a/src/gui/kernel/qplatformintegration.cpp +++ b/src/gui/kernel/qplatformintegration.cpp @@ -482,6 +482,9 @@ void QPlatformIntegration::screenAdded(QPlatformScreen *ps, bool isPrimary) } else { QGuiApplicationPrivate::screen_list.append(screen); } + + QGuiApplicationPrivate::resetCachedDevicePixelRatio(); + emit qGuiApp->screenAdded(screen); if (isPrimary) @@ -499,6 +502,8 @@ void QPlatformIntegration::removeScreen(QScreen *screen) const bool wasPrimary = (!QGuiApplicationPrivate::screen_list.isEmpty() && QGuiApplicationPrivate::screen_list.at(0) == screen); QGuiApplicationPrivate::screen_list.removeOne(screen); + QGuiApplicationPrivate::resetCachedDevicePixelRatio(); + if (wasPrimary && qGuiApp && !QGuiApplicationPrivate::screen_list.isEmpty()) emit qGuiApp->primaryScreenChanged(QGuiApplicationPrivate::screen_list.at(0)); } @@ -534,7 +539,7 @@ void QPlatformIntegration::setPrimaryScreen(QPlatformScreen *newPrimary) if (idx == 0) return; - QGuiApplicationPrivate::screen_list.swap(0, idx); + QGuiApplicationPrivate::screen_list.swapItemsAt(0, idx); emit qGuiApp->primaryScreenChanged(newPrimaryScreen); } |