module-rt: fix warning when xdg-desktop-portal isn't running

$ pipewire
...
[W][1234.001] mod.rt       | [     module-rt.c:  278 pw_rtkit_check_xdg_portal()] Can't find xdg-portal: (null)
...
This commit is contained in:
Jan Beich 2023-01-08 02:06:35 +00:00
parent b2f43e7bad
commit 6d58c73937

View file

@ -269,20 +269,12 @@ struct pw_rtkit_bus *pw_rtkit_bus_get_session(void)
bool pw_rtkit_check_xdg_portal(struct pw_rtkit_bus *system_bus) bool pw_rtkit_check_xdg_portal(struct pw_rtkit_bus *system_bus)
{ {
DBusError error; if (!dbus_bus_name_has_owner(system_bus->bus, XDG_PORTAL_SERVICE_NAME, NULL)) {
bool ret = true; pw_log_warn("Can't find %s. Is xdg-desktop-portal running?", XDG_PORTAL_SERVICE_NAME);
return false;
dbus_error_init(&error);
if (!dbus_bus_name_has_owner(system_bus->bus, XDG_PORTAL_SERVICE_NAME, &error)) {
pw_log_warn("Can't find xdg-portal: %s", error.name);
ret = false;
goto finish;
} }
finish:
dbus_error_free(&error);
return ret; return true;
} }
void pw_rtkit_bus_free(struct pw_rtkit_bus *system_bus) void pw_rtkit_bus_free(struct pw_rtkit_bus *system_bus)