From 7916352f5b15081612003d1ff4d5f02c08a2353e Mon Sep 17 00:00:00 2001 From: Aleix Pol Gonzalez Date: Fri, 26 Apr 2024 18:04:06 +0200 Subject: [PATCH] wayland: skip the outputs refresh if they didn't change We have a bunch of logic in there that is effectively no-op if the values don't change. We might as well skip it altogether and save some code from being run to do nothing. Signed-off-by: Victoria Fischer --- src/wayland/surface.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/wayland/surface.cpp b/src/wayland/surface.cpp index 7a2a85093a..c41fa51679 100644 --- a/src/wayland/surface.cpp +++ b/src/wayland/surface.cpp @@ -915,6 +915,10 @@ QList SurfaceInterface::outputs() const void SurfaceInterface::setOutputs(const QList &outputs, OutputInterface *primaryOutput) { + if (d->outputs == outputs && d->primaryOutput == primaryOutput) { + return; + } + QList removedOutputs = d->outputs; for (auto it = outputs.constBegin(), end = outputs.constEnd(); it != end; ++it) { const auto o = *it;