From d3275784a85d5efb8460af4d82414f1ada91fa65 Mon Sep 17 00:00:00 2001 From: Aleix Pol Date: Thu, 25 Apr 2019 00:45:14 +0100 Subject: [PATCH] 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 --- plugins/platforms/drm/drm_backend.cpp | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/plugins/platforms/drm/drm_backend.cpp b/plugins/platforms/drm/drm_backend.cpp index 10f1fef091..17f7a7b5d5 100644 --- a/plugins/platforms/drm/drm_backend.cpp +++ b/plugins/platforms/drm/drm_backend.cpp @@ -523,7 +523,8 @@ void DrmBackend::readOutputsConfiguration() const auto outputConfig = configGroup.group((*it)->uuid()); (*it)->setGlobalPos(outputConfig.readEntry("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()); } }