Do not re-read output configuration if the outputs didn't change

They would override KScreen in case we were using a dock station that
brings 2 displays.
We'd get:
- udev: event for the first hotplughed screen
- kwin: process all screens properly (both)
- kscreen: would offer the right configuration for such displays
- udev: process the event for the second hotplug udev event
- kwin: restore the configuration
- kscreen: would think this is a conscious decision and embrace it as a
configuration

With this change we are only re-reading the configuration in case the
outputs changed.
This commit is contained in:
Aleix Pol 2020-10-26 18:35:58 +01:00 committed by Aleix Pol Gonzalez
parent f9becf8085
commit e0c965d316
2 changed files with 5 additions and 2 deletions

View file

@ -341,11 +341,14 @@ bool DrmBackend::updateOutputs()
if (m_gpus.size() == 0) {
return false;
}
const auto oldOutputs = m_outputs;
for (auto gpu : m_gpus)
gpu->updateOutputs();
std::sort(m_outputs.begin(), m_outputs.end(), [] (DrmOutput *a, DrmOutput *b) { return a->m_conn->id() < b->m_conn->id(); });
readOutputsConfiguration();
if (oldOutputs != m_outputs) {
readOutputsConfiguration();
}
updateOutputsEnabled();
if (!m_outputs.isEmpty()) {
emit screensQueried();

View file

@ -352,7 +352,7 @@ void DrmOutput::initEdid(drmModeConnector *connector)
}
}
if (!edid) {
qDebug() << "could not find edid for connector" << connector << connector->connector_id;
qCWarning(KWIN_DRM) << "Could not find edid for connector" << connector << connector->connector_id;
return;
}