Commit f1483b11 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

platforms/virtual: Emit outputAdded and outputRemoved

Otherwise things that rely on those two signals may introduce undefined
behavior in autotests.
parent 9d5a1b05
......@@ -110,8 +110,12 @@ void VirtualBackend::setVirtualOutputs(int count, QVector<QRect> geometries, QVe
Q_ASSERT(scales.size() == 0 || scales.size() == count);
bool countChanged = m_outputs.size() != count;
qDeleteAll(m_outputs.begin(), m_outputs.end());
m_outputs.resize(count);
while (!m_outputs.isEmpty()) {
VirtualOutput *output = m_outputs.takeLast();
emit outputRemoved(output);
delete output;
}
int sumWidth = 0;
for (int i = 0; i < count; i++) {
......@@ -126,7 +130,8 @@ void VirtualBackend::setVirtualOutputs(int count, QVector<QRect> geometries, QVe
if (scales.size()) {
vo->setScale(scales.at(i));
}
m_outputs[i] = vo;
m_outputs.append(vo);
emit outputAdded(vo);
}
emit virtualOutputsSet(countChanged);
......
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