diff --git a/gtk/a11y/gtkatspicontext.c b/gtk/a11y/gtkatspicontext.c index 10eecbdfe4..46b157a3fa 100644 --- a/gtk/a11y/gtkatspicontext.c +++ b/gtk/a11y/gtkatspicontext.c @@ -1598,7 +1598,7 @@ get_bus_address_dbus (GdkDisplay *display) if (error != NULL) { - g_critical ("Unable to acquire session bus: %s", error->message); + GTK_NOTE (A11Y, g_message ("Unable to acquire session bus: %s", error->message)); g_error_free (error); return NULL; } @@ -1615,8 +1615,8 @@ get_bus_address_dbus (GdkDisplay *display) &error); if (error != NULL) { - g_critical ("Unable to acquire the address of the accessibility bus: %s", - error->message); + GTK_NOTE (A11Y, g_message ("Unable to acquire the address of the accessibility bus: %s", + error->message)); g_error_free (error); } @@ -1711,9 +1711,17 @@ gtk_at_spi_create_context (GtkAccessibleRole accessible_role, g_return_val_if_fail (GTK_IS_ACCESSIBLE (accessible), NULL); g_return_val_if_fail (GDK_IS_DISPLAY (display), NULL); - const char *bus_address = get_bus_address (display); + static const char *bus_address; if (bus_address == NULL) + { + bus_address = get_bus_address (display); + + if (bus_address == NULL) + bus_address = ""; + } + + if (*bus_address == '\0') return NULL; #if defined(GDK_WINDOWING_WAYLAND)