diff options
author | Emmanuele Bassi <ebassi@gnome.org> | 2020-11-22 18:40:50 +0000 |
---|---|---|
committer | Emmanuele Bassi <ebassi@gnome.org> | 2020-11-23 14:34:46 +0000 |
commit | ef86e46238df288cccc2addf58512d010279192d (patch) | |
tree | 8d66ee98a03b2cc4c489e25197e35ddb49c21e5a | |
parent | 0a46baeb5684533c7300b6b5212a7fd080f71d98 (diff) | |
download | gtk+-ef86e46238df288cccc2addf58512d010279192d.tar.gz |
a11y: Cache the accessibility bus address
Just check for it once; doing it every time we failed to create an
ATContext is just going to fill up the logs.
-rw-r--r-- | gtk/a11y/gtkatspicontext.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/gtk/a11y/gtkatspicontext.c b/gtk/a11y/gtkatspicontext.c index 3216c33a40..46b157a3fa 100644 --- a/gtk/a11y/gtkatspicontext.c +++ b/gtk/a11y/gtkatspicontext.c @@ -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) |