Commit 4b12afce 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
parent 9b09f039
......@@ -56,6 +56,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;
QSocketNotifier *notifier = new QSocketNotifier(pw_loop_get_fd(pwMainLoop), QSocketNotifier::Read, this);
Supports Markdown
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