Commit 2d5482b0 authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

plugins/x11: Emit outputAdded and outputRemoved

Currently, these two signals are emitted primarily only on Wayland, but
in order to have consistent core API, it's better to emit them on X11 too.
parent 38940780
......@@ -431,13 +431,17 @@ void X11StandalonePlatform::doUpdateOutputs()
o->setRefreshRate(60000);
o->setName(QStringLiteral("Xinerama"));
m_outputs << o;
emit outputAdded(o);
};
// TODO: instead of resetting all outputs, check if new output is added/removed
// or still available and leave still available outputs in m_outputs
// untouched (like in DRM backend)
qDeleteAll(m_outputs);
m_outputs.clear();
while (!m_outputs.isEmpty()) {
X11Output *output = m_outputs.takeLast();
emit outputRemoved(output);
delete output;
}
if (!Xcb::Extensions::self()->isRandrAvailable()) {
fallback();
......@@ -523,6 +527,7 @@ void X11StandalonePlatform::doUpdateOutputs()
}
m_outputs << o;
emit outputAdded(o);
}
}
......
......@@ -177,6 +177,7 @@ void X11WindowedBackend::createOutputs()
logicalWidthSum += logicalWidth;
m_outputs << output;
emit outputAdded(output);
}
updateWindowTitle();
......@@ -381,6 +382,7 @@ void X11WindowedBackend::handleClientMessage(xcb_client_message_event_t *event)
x += (*it)->geometry().width();
}
emit outputRemoved(removedOutput);
delete removedOutput;
QMetaObject::invokeMethod(screens(), "updateCount");
}
......
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