summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/offscreen/qoffscreenintegration.cpp
diff options
context:
space:
mode:
authorTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-09-09 19:04:30 +0200
committerTor Arne Vestbø <tor.arne.vestbo@qt.io>2022-09-09 23:23:22 +0200
commitad751a03900313db2b6058b3425ec5a176602cc2 (patch)
tree77e660cb9f05636d59f77a1d2f9260d11663424b /src/plugins/platforms/offscreen/qoffscreenintegration.cpp
parent4d044d20c5ea8df5cbe8ad7667c30a6d150d8eb3 (diff)
QOffscreenIntegration: Don't keep around removed screens
The implementation of QOffscreenScreen::virtualSiblings() uses the list of screens maintained in QOffscreenIntegration as input, so we need to remove screens from this list as we remove them, to avoid treating removed screens as siblings of still remaining screens. While we're at it, remove the screens in reverse order, so that the primary screen is the one removed last. This avoids having to update the primary screen and move windows for each screen removed during shutdown. Change-Id: I9ab09dd75dbe20f63b9154533613bc59da531fd1 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
Diffstat (limited to 'src/plugins/platforms/offscreen/qoffscreenintegration.cpp')
-rw-r--r--src/plugins/platforms/offscreen/qoffscreenintegration.cpp4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/plugins/platforms/offscreen/qoffscreenintegration.cpp b/src/plugins/platforms/offscreen/qoffscreenintegration.cpp
index cb02205601..4cd58422c6 100644
--- a/src/plugins/platforms/offscreen/qoffscreenintegration.cpp
+++ b/src/plugins/platforms/offscreen/qoffscreenintegration.cpp
@@ -82,8 +82,8 @@ QOffscreenIntegration::QOffscreenIntegration(const QStringList& paramList)
QOffscreenIntegration::~QOffscreenIntegration()
{
- for (auto screen : std::as_const(m_screens))
- QWindowSystemInterface::handleScreenRemoved(screen);
+ while (!m_screens.isEmpty())
+ QWindowSystemInterface::handleScreenRemoved(m_screens.takeLast());
}
/*