2021-09-28 08:29:56 +00:00
|
|
|
/*
|
|
|
|
KWin - the KDE window manager
|
|
|
|
This file is part of the KDE project.
|
|
|
|
|
|
|
|
SPDX-FileCopyrightText: 2021 Xaver Hugl <xaver.hugl@gmail.com>
|
|
|
|
|
|
|
|
SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
*/
|
2022-04-14 10:51:20 +00:00
|
|
|
#include "outputconfiguration.h"
|
2021-09-28 08:29:56 +00:00
|
|
|
|
|
|
|
namespace KWin
|
|
|
|
{
|
|
|
|
|
2022-04-14 10:51:20 +00:00
|
|
|
QSharedPointer<OutputChangeSet> OutputConfiguration::changeSet(AbstractOutput *output)
|
2021-09-28 08:29:56 +00:00
|
|
|
{
|
|
|
|
const auto ptr = constChangeSet(output);
|
|
|
|
m_properties[output] = ptr;
|
|
|
|
return ptr;
|
|
|
|
}
|
|
|
|
|
2022-04-14 10:51:20 +00:00
|
|
|
QSharedPointer<OutputChangeSet> OutputConfiguration::constChangeSet(AbstractOutput *output) const
|
2021-09-28 08:29:56 +00:00
|
|
|
{
|
|
|
|
if (!m_properties.contains(output)) {
|
|
|
|
auto props = QSharedPointer<OutputChangeSet>::create();
|
|
|
|
props->enabled = output->isEnabled();
|
|
|
|
props->pos = output->geometry().topLeft();
|
|
|
|
props->scale = output->scale();
|
|
|
|
props->modeSize = output->modeSize();
|
|
|
|
props->refreshRate = output->refreshRate();
|
|
|
|
props->transform = output->transform();
|
|
|
|
props->overscan = output->overscan();
|
|
|
|
props->rgbRange = output->rgbRange();
|
|
|
|
props->vrrPolicy = output->vrrPolicy();
|
|
|
|
return props;
|
|
|
|
}
|
|
|
|
return m_properties[output];
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|