ScreenshotEffect: fix ordering of screens in screenshotScreens

This commit is contained in:
Méven Car 2020-10-06 17:07:05 +02:00
parent de4e429aed
commit a7aa089ec4

View file

@ -720,11 +720,9 @@ void ScreenShotEffect::screenshotScreens(QDBusUnixFileDescriptor fd, const QStri
const QList<QScreen *> screens = QGuiApplication::screens(); const QList<QScreen *> screens = QGuiApplication::screens();
QStringList lscreensNames = screensNames;
for (const QScreen *screen : screens) { for (const QScreen *screen : screens) {
const int indexName = lscreensNames.indexOf(screen->name()); const int indexName = screensNames.indexOf(screen->name());
if (indexName != -1) { if (indexName != -1) {
lscreensNames.removeAt(indexName);
const auto screenGeom = screen->geometry(); const auto screenGeom = screen->geometry();
if (!screenGeom.isValid()) { if (!screenGeom.isValid()) {
close(m_fd); close(m_fd);
@ -737,10 +735,10 @@ void ScreenShotEffect::screenshotScreens(QDBusUnixFileDescriptor fd, const QStri
} }
} }
if (!lscreensNames.isEmpty()) { if (m_orderImg.size() != screensNames.size()) {
close(m_fd); close(m_fd);
clearState(); clearState();
sendErrorReply(s_errorScreenMissing, s_errorScreenMissingMsg + " : " + lscreensNames.join(", ")); sendErrorReply(s_errorScreenMissing, s_errorScreenMissingMsg);
return; return;
} }