Check for the session bus before using it

Patch by Chris Allen, #475
This commit is contained in:
Matthias Clasen 2019-01-02 20:35:19 -05:00
parent 3da9280a8a
commit 7e7c90961c

View File

@ -424,7 +424,7 @@ gtk_application_impl_dbus_startup (GtkApplicationImpl *impl,
"gtk-shell-shows-menubar", FALSE, "gtk-shell-shows-menubar", FALSE,
NULL); NULL);
if (dbus->sm_proxy == NULL) if (dbus->sm_proxy == NULL && dbus->session)
{ {
dbus->inhibit_proxy = gtk_application_get_proxy_if_service_present (dbus->session, dbus->inhibit_proxy = gtk_application_get_proxy_if_service_present (dbus->session,
G_DBUS_PROXY_FLAGS_NONE, G_DBUS_PROXY_FLAGS_NONE,