on xenial help sign in
Fix the detach assigning to a const list
commit412458d2e6f2508cc437030e598bc01eb867cb76 authorAlbert Astals Cid <albert.astals@canonical.com> dateFri 20 Nov 2015, 16:31 (11 years ago) parent38640eb
1 file changed+4−3
src/ShellApplication.cpp+4−3
src/ShellApplication.cpp+4−3
@@ -183,12 +183,13 @@ void ShellApplication::onScreenAboutToBeRemoved(QScreen *screen)
183183 // TODO: Support an arbitrary number of screens and different policies
184184 // (eg cloned desktop, several desktops, etc)
185185 if (screen == m_shellView->screen()) {
186− Q_ASSERT(screens().count() > 1);
187− Q_ASSERT(screens().at(0) != screen);
186+ const QList<QScreen *> allScreens = screens();
187+ Q_ASSERT(allScreens.count() > 1);
188+ Q_ASSERT(allScreens.at(0) != screen);
188189 Q_ASSERT(m_secondaryWindow);
189190 delete m_secondaryWindow;
190191 m_secondaryWindow = nullptr;
191− m_shellView->setScreen(screens().at(0));
192+ m_shellView->setScreen(allScreens.first());
192193 m_qmlArgs.setDeviceName(m_deviceName);
193194 // Changing the QScreen where a QWindow is drawn makes it also lose focus (besides having
194195 // its backing QPlatformWindow recreated). So lets refocus it.