diff --git a/src/core/linux/SDL_dbus.c b/src/core/linux/SDL_dbus.c index 8a279b474..02579aa30 100644 --- a/src/core/linux/SDL_dbus.c +++ b/src/core/linux/SDL_dbus.c @@ -65,6 +65,7 @@ LoadDBUSSyms(void) SDL_DBUS_SYM(message_iter_get_arg_type); SDL_DBUS_SYM(message_iter_recurse); SDL_DBUS_SYM(message_unref); + SDL_DBUS_SYM(threads_init_default); SDL_DBUS_SYM(error_init); SDL_DBUS_SYM(error_is_set); SDL_DBUS_SYM(error_free); @@ -124,6 +125,11 @@ SDL_DBus_Init(void) return; /* oh well */ } + if (!dbus.threads_init_default()) { + is_dbus_available = SDL_FALSE; + return; + } + dbus.error_init(&err); /* session bus is required */ diff --git a/src/core/linux/SDL_dbus.h b/src/core/linux/SDL_dbus.h index 6967cc9b9..9f77512aa 100644 --- a/src/core/linux/SDL_dbus.h +++ b/src/core/linux/SDL_dbus.h @@ -62,6 +62,7 @@ typedef struct SDL_DBusContext { int (*message_iter_get_arg_type)(DBusMessageIter *); void (*message_iter_recurse)(DBusMessageIter *, DBusMessageIter *); void (*message_unref)(DBusMessage *); + dbus_bool_t (*threads_init_default)(void); void (*error_init)(DBusError *); dbus_bool_t (*error_is_set)(const DBusError *); void (*error_free)(DBusError *);