diff --git a/effects/screenshot/screenshot.cpp b/effects/screenshot/screenshot.cpp index c50c51506d..191baae256 100644 --- a/effects/screenshot/screenshot.cpp +++ b/effects/screenshot/screenshot.cpp @@ -720,11 +720,9 @@ void ScreenShotEffect::screenshotScreens(QDBusUnixFileDescriptor fd, const QStri const QList screens = QGuiApplication::screens(); - QStringList lscreensNames = screensNames; for (const QScreen *screen : screens) { - const int indexName = lscreensNames.indexOf(screen->name()); + const int indexName = screensNames.indexOf(screen->name()); if (indexName != -1) { - lscreensNames.removeAt(indexName); const auto screenGeom = screen->geometry(); if (!screenGeom.isValid()) { 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); clearState(); - sendErrorReply(s_errorScreenMissing, s_errorScreenMissingMsg + " : " + lscreensNames.join(", ")); + sendErrorReply(s_errorScreenMissing, s_errorScreenMissingMsg); return; }