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 <victoria.fischer@mbition.io>
This commit is contained in:
Aleix Pol Gonzalez 2024-04-26 18:04:06 +02:00 committed by Aleix Pol Gonzalez
parent cdbe119789
commit 7916352f5b

View file

@ -915,6 +915,10 @@ QList<OutputInterface *> SurfaceInterface::outputs() const
void SurfaceInterface::setOutputs(const QList<OutputInterface *> &outputs, OutputInterface *primaryOutput)
{
if (d->outputs == outputs && d->primaryOutput == primaryOutput) {
return;
}
QList<OutputInterface *> removedOutputs = d->outputs;
for (auto it = outputs.constBegin(), end = outputs.constEnd(); it != end; ++it) {
const auto o = *it;