Fix mishandling of output configuration if output monitor EDID is missing

This functionally fixes
* duplication of output configuration in ~/.config/kwinoutputconfig.json
* _wrong_ ouput configuration - in particular the scale - being restored (i.e. scale would never be restored)
This commit is contained in:
Stefan Hoffmeister 2024-01-19 13:52:28 +00:00 committed by Xaver Hugl
parent cffacc514d
commit d563bc6c86

View file

@ -137,10 +137,12 @@ std::optional<size_t> OutputConfigurationStore::findOutput(Output *output, const
return otherOutput != output && otherOutput->edid().identifier() == output->edid().identifier() && otherOutput->mstPath() == output->mstPath();
});
const auto it = std::find_if(m_outputs.begin(), m_outputs.end(), [uniqueEdid, uniqueMst, output](const auto &outputState) {
if (outputState.edidIdentifier != output->edid().identifier()) {
return false;
} else if (uniqueEdid) {
return true;
if (output->edid().isValid()) {
if (outputState.edidIdentifier != output->edid().identifier()) {
return false;
} else if (uniqueEdid) {
return true;
}
}
if (outputState.mstPath != output->mstPath()) {
return false;