LINUX: add system bus support
This commit is contained in:
parent
3d47ab90f1
commit
31afe3372d
|
@ -189,8 +189,17 @@ bool backend::init() {
|
||||||
|
|
||||||
conn = dbus_bus_get(DBUS_BUS_SESSION, &err);
|
conn = dbus_bus_get(DBUS_BUS_SESSION, &err);
|
||||||
if (!conn) {
|
if (!conn) {
|
||||||
dbus_error_free(&err);
|
if (dbus_error_is_set(&err))
|
||||||
return false;
|
dbus_error_free(&err);
|
||||||
|
|
||||||
|
//fallback to system bus if user doesn't have a session specific bus
|
||||||
|
conn = dbus_bus_get(DBUS_BUS_SYSTEM, &err);
|
||||||
|
if(!conn) {
|
||||||
|
if (dbus_error_is_set(&err))
|
||||||
|
dbus_error_free(&err);
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue