From 9c4bcb92c30e8f4012cd8b56cf3aec00fa4c82a7 Mon Sep 17 00:00:00 2001 From: Vlad Zahorodnii Date: Tue, 6 Sep 2022 17:54:52 +0300 Subject: [PATCH] backends/drm: Don't sort DrmBackend::m_outputs This std::sort() function traces its origin back to cbbd684430cf3da7afeff1149a65fcd867766b5f. The sort step was necessary to ensure that we get same configuration hash regardless the order in which outputs were connected. On the other hand, our KWinKScreenIntegration code already does that so it seems excessive to sort outputs the second time. --- src/backends/drm/drm_backend.cpp | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/src/backends/drm/drm_backend.cpp b/src/backends/drm/drm_backend.cpp index cbed0b781c..dac156a15a 100644 --- a/src/backends/drm/drm_backend.cpp +++ b/src/backends/drm/drm_backend.cpp @@ -341,17 +341,6 @@ void DrmBackend::updateOutputs() } } - std::sort(m_outputs.begin(), m_outputs.end(), [](DrmAbstractOutput *a, DrmAbstractOutput *b) { - auto da = qobject_cast(a); - auto db = qobject_cast(b); - if (da && !db) { - return true; - } else if (da && db) { - return da->pipeline()->connector()->id() < db->pipeline()->connector()->id(); - } else { - return false; - } - }); Q_EMIT screensQueried(); }