screencast: Handle the case where pipewire is not installed
If pipewire is not installed, pw_loop_new() may return a nullptr. BUG: 427949
This commit is contained in:
parent
9b09f0399f
commit
4b12afced9
1 changed files with 5 additions and 0 deletions
|
@ -56,6 +56,11 @@ void PipeWireCore::onCoreError(void* data, uint32_t id, int seq, int res, const
|
||||||
bool PipeWireCore::init()
|
bool PipeWireCore::init()
|
||||||
{
|
{
|
||||||
pwMainLoop = pw_loop_new(nullptr);
|
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);
|
pw_loop_enter(pwMainLoop);
|
||||||
|
|
||||||
QSocketNotifier *notifier = new QSocketNotifier(pw_loop_get_fd(pwMainLoop), QSocketNotifier::Read, this);
|
QSocketNotifier *notifier = new QSocketNotifier(pw_loop_get_fd(pwMainLoop), QSocketNotifier::Read, this);
|
||||||
|
|
Loading…
Reference in a new issue