[plasma/kwin] src/plugins/outputlocator: outputlocator: sort output locator screens by priority
Nate Graham <[email protected]>
| Newsgroups | gmane.comp.kde.cvs |
|---|---|
| Message-ID | <[email protected]> |
Git commit 5d2d6858fbe56d3d2cb09e807f5526e80f9d9474 by Nate Graham, on behalf of Ramil Nurmanov.
Committed on 22/07/2026 at 17:17.
Pushed by ngraham into branch 'master'.
outputlocator: sort output locator screens by priority
Sort screens in the Output Locator by output priority before falling
back to their names.
This keeps monitor numbers consistent with KScreen, where the primary
output with priority `1` is displayed as monitor `1`.
Related KScreen MR: https://invent.kde.org/plasma/kscreen/-/merge_requests/502
CCBUG: 523182
M +6 -0 src/plugins/outputlocator/outputlocator.cpp
https://invent.kde.org/plasma/kwin/-/commit/5d2d6858fbe56d3d2cb09e807f5526e80f9d9474
diff --git a/src/plugins/outputlocator/outputlocator.cpp b/src/plugins/outputlocator/outputlocator.cpp
index 43fc501fa86..f21b4b29ca6 100644
--- a/src/plugins/outputlocator/outputlocator.cpp
+++ b/src/plugins/outputlocator/outputlocator.cpp
@@ -5,6 +5,7 @@
*/
#include "outputlocator.h"
+#include "core/backendoutput.h"
#include "core/output.h"
#include "effect/effecthandler.h"
#include "effect/offscreenquickview.h"
@@ -71,6 +72,11 @@ void OutputLocatorEffect::show()
// Sort screens in the same order as KScreen does
QList<LogicalOutput *> sortedScreens = screens;
std::sort(sortedScreens.begin(), sortedScreens.end(), [](LogicalOutput *a, LogicalOutput *b) {
+ const uint32_t priorityA = a->backendOutput()->priority();
+ const uint32_t priorityB = b->backendOutput()->priority();
+ if (priorityA != priorityB) {
+ return priorityA < priorityB;
+ }
return QString::compare(a->name(), b->name(), Qt::CaseInsensitive) < 0;
});