Skip to content
Permalink
Browse files

dbus: System bus is optional, we only need a session bus (thanks, tam…

…o!).

Fixes Bugzilla #4795.
  • Loading branch information
icculus committed Mar 27, 2020
1 parent 07f231e commit 369e5f33fba36aaeb057d7cc3c06d5cdb8018b2b
Showing with 10 additions and 4 deletions.
  1. +10 −4 src/core/linux/SDL_dbus.c
@@ -125,18 +125,24 @@ SDL_DBus_Init(void)
}

dbus.error_init(&err);
/* session bus is required */

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)) {
dbus.error_free(&err);
SDL_DBus_Quit();
is_dbus_available = SDL_FALSE;
return; /* oh well */
}
dbus.connection_set_exit_on_disconnect(dbus.system_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);
}
}

0 comments on commit 369e5f3

Please sign in to comment.