From ad751a03900313db2b6058b3425ec5a176602cc2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Tor=20Arne=20Vestb=C3=B8?= Date: Fri, 9 Sep 2022 19:04:30 +0200 Subject: 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 --- src/plugins/platforms/offscreen/qoffscreenintegration.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/plugins/platforms') 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()); } /* -- cgit v1.2.3