mirror of https://github.com/encounter/SDL.git
dbus: System bus is optional, we only need a session bus (thanks, tamo!).
Fixes Bugzilla #4795.
This commit is contained in:
parent
07f231eeae
commit
369e5f33fb
|
@ -125,18 +125,24 @@ SDL_DBus_Init(void)
|
||||||
}
|
}
|
||||||
|
|
||||||
dbus.error_init(&err);
|
dbus.error_init(&err);
|
||||||
|
/* session bus is required */
|
||||||
|
|
||||||
dbus.session_conn = dbus.bus_get_private(DBUS_BUS_SESSION, &err);
|
dbus.session_conn = dbus.bus_get_private(DBUS_BUS_SESSION, &err);
|
||||||
if (!dbus.error_is_set(&err)) {
|
|
||||||
dbus.system_conn = dbus.bus_get_private(DBUS_BUS_SYSTEM, &err);
|
|
||||||
}
|
|
||||||
if (dbus.error_is_set(&err)) {
|
if (dbus.error_is_set(&err)) {
|
||||||
dbus.error_free(&err);
|
dbus.error_free(&err);
|
||||||
SDL_DBus_Quit();
|
SDL_DBus_Quit();
|
||||||
is_dbus_available = SDL_FALSE;
|
is_dbus_available = SDL_FALSE;
|
||||||
return; /* oh well */
|
return; /* oh well */
|
||||||
}
|
}
|
||||||
dbus.connection_set_exit_on_disconnect(dbus.system_conn, 0);
|
|
||||||
dbus.connection_set_exit_on_disconnect(dbus.session_conn, 0);
|
dbus.connection_set_exit_on_disconnect(dbus.session_conn, 0);
|
||||||
|
|
||||||
|
/* system bus is optional */
|
||||||
|
dbus.system_conn = dbus.bus_get_private(DBUS_BUS_SYSTEM, &err);
|
||||||
|
if (!dbus.error_is_set(&err)) {
|
||||||
|
dbus.connection_set_exit_on_disconnect(dbus.system_conn, 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
dbus.error_free(&err);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue