Don't rescale every output every time outputs change

Summary:
Every time a display gets connected/disconnected, every output will be
reinitialized. We don't really need to reset the scaling to 1 every time
we don't know, especially since the setting has been set voluntarily.

Test Plan: When I disconnect the external display, my laptop doesn't fallback to scale=1.

Reviewers: #plasma, apol

Reviewed By: apol

Subscribers: davidedmundson, ngraham, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D20521
This commit is contained in:
Aleix Pol 2019-04-25 00:45:14 +01:00 committed by David Edmundson
parent c4ab885616
commit d3275784a8

View file

@ -523,7 +523,8 @@ void DrmBackend::readOutputsConfiguration()
const auto outputConfig = configGroup.group((*it)->uuid());
(*it)->setGlobalPos(outputConfig.readEntry<QPoint>("Position", pos));
// TODO: add mode
(*it)->setScale(outputConfig.readEntry("Scale", 1.0));
if (outputConfig.hasKey("Scale"))
(*it)->setScale(outputConfig.readEntry("Scale", 1.0));
pos.setX(pos.x() + (*it)->geometry().width());
}
}