Commit 6577a35e authored by Vlad Zahorodnii's avatar Vlad Zahorodnii
Browse files

screencast: Handle the case where pipewire is not installed

If pipewire is not installed, pw_loop_new() may return a nullptr.

BUG: 427949


(cherry picked from commit 4b12afce)
parent 9d2b27ae
......@@ -57,6 +57,11 @@ void PipeWireCore::onCoreError(void* data, uint32_t id, int seq, int res, const
bool PipeWireCore::init()
{
pwMainLoop = pw_loop_new(nullptr);
if (!pwMainLoop) {
qCWarning(KWIN_SCREENCAST, "Failed to create PipeWire loop: %s", strerror(errno));
m_error = i18n("Failed to start main PipeWire loop");
return false;
}
pw_loop_enter(pwMainLoop);
QSocketNotifier *notifier = new QSocketNotifier(pw_loop_get_fd(pwMainLoop), QSocketNotifier::Read, this);
......
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