LINUX: add system bus support
This commit is contained in:
parent
3d47ab90f1
commit
31afe3372d
|
@ -189,9 +189,18 @@ bool backend::init() {
|
|||
|
||||
conn = dbus_bus_get(DBUS_BUS_SESSION, &err);
|
||||
if (!conn) {
|
||||
if (dbus_error_is_set(&err))
|
||||
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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue