diff --git a/src/plugins/screencast/outputscreencastsource.cpp b/src/plugins/screencast/outputscreencastsource.cpp index 17788d2640..0c0706a2a0 100644 --- a/src/plugins/screencast/outputscreencastsource.cpp +++ b/src/plugins/screencast/outputscreencastsource.cpp @@ -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