screencasting: Close streams when the output is disabled

It's technically possible to keep it somewhat going right now and just
not send frames but it doesn't make much intuitive sense.
This commit is contained in:
Aleix Pol Gonzalez 2023-02-27 15:42:07 +00:00 committed by Vlad Zahorodnii
parent fff462aed6
commit 4cda16ce3a

View file

@ -22,6 +22,11 @@ OutputScreenCastSource::OutputScreenCastSource(Output *output, QObject *parent)
, m_output(output)
{
connect(m_output, &QObject::destroyed, this, &ScreenCastSource::closed);
connect(m_output, &Output::enabledChanged, this, [this] {
if (!m_output->isEnabled()) {
Q_EMIT closed();
}
});
}
bool OutputScreenCastSource::hasAlphaChannel() const