From a7aa089ec494c4eaca3d78ef3368a306fb1609d7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C3=A9ven=20Car?= Date: Tue, 6 Oct 2020 17:07:05 +0200 Subject: [PATCH] ScreenshotEffect: fix ordering of screens in screenshotScreens --- effects/screenshot/screenshot.cpp | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) 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; }