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>
bb10
Tor Arne Vestbø 2022-09-09 19:04:30 +02:00
parent 4d044d20c5
commit ad751a0390
1 changed files with 2 additions and 2 deletions

View File

@ -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());
}
/*