Members of the KDE Community are recommended to subscribe to the kde-community mailing list at https://mail.kde.org/mailman/listinfo/kde-community to allow them to participate in important discussions and receive other important announcements

Commit 03f79868 authored by David Edmundson's avatar David Edmundson

[platforms/virtual] Add API to set scale in virtual backend

Summary: For unit test purposes

Test Plan: Used by unit test InternalWindowTest::testScale in linked commit

Reviewers: #kwin, graesslin

Reviewed By: #kwin, graesslin

Subscribers: kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D18086
parent e6c06801
......@@ -124,9 +124,10 @@ Outputs VirtualBackend::enabledOutputs() const
return m_enabledOutputs;
}
void VirtualBackend::setVirtualOutputs(int count, QVector<QRect> geometries)
void VirtualBackend::setVirtualOutputs(int count, QVector<QRect> geometries, QVector<int> scales)
{
Q_ASSERT(geometries.size() == 0 || geometries.size() == count);
Q_ASSERT(scales.size() == 0 || scales.size() == count);
bool countChanged = m_outputs.size() != count;
qDeleteAll(m_outputs.begin(), m_outputs.end());
......@@ -136,6 +137,9 @@ void VirtualBackend::setVirtualOutputs(int count, QVector<QRect> geometries)
int sumWidth = 0;
for (int i = 0; i < count; i++) {
VirtualOutput *vo = new VirtualOutput(this);
if (scales.size()) {
vo->setScale(scales.at(i));
}
if (geometries.size()) {
vo->setGeometry(geometries.at(i));
} else if (!vo->geometry().isValid()) {
......
......@@ -54,7 +54,7 @@ public:
QPainterBackend* createQPainterBackend() override;
OpenGLBackend *createOpenGLBackend() override;
Q_INVOKABLE void setVirtualOutputs(int count, QVector<QRect> geometries = QVector<QRect>());
Q_INVOKABLE void setVirtualOutputs(int count, QVector<QRect> geometries = QVector<QRect>(), QVector<int> scales = QVector<int>());
Outputs outputs() const override;
Outputs enabledOutputs() const override;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment