Only use dbus session for root when DISPLAY is set
This commit is contained in:
parent
575170d891
commit
6e1f028b37
1 changed files with 15 additions and 1 deletions
|
@ -148,7 +148,21 @@ XboxdrvDaemon::run()
|
|||
switch(m_opts.dbus)
|
||||
{
|
||||
case Options::kDBusAuto:
|
||||
dbus_bus_type = DBUS_BUS_SESSION;
|
||||
if (getuid() == 0)
|
||||
{
|
||||
if (getenv("DISPLAY"))
|
||||
{
|
||||
dbus_bus_type = DBUS_BUS_SESSION;
|
||||
}
|
||||
else
|
||||
{
|
||||
dbus_bus_type = DBUS_BUS_SYSTEM;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
dbus_bus_type = DBUS_BUS_SESSION;
|
||||
}
|
||||
break;
|
||||
|
||||
case Options::kDBusSession:
|
||||
|
|
Loading…
Reference in a new issue