atspicontext: Cache empty atspi bus address
authorCorey Berla <corey@berla.me>
Tue, 29 Nov 2022 00:32:52 +0000 (16:32 -0800)
committerCorey Berla <corey@berla.me>
Tue, 29 Nov 2022 01:02:13 +0000 (17:02 -0800)
We are caching the bus address as data on the display object when it
exists, but fail to set the data when the bus address doesn't exist.
That causing excessive calls to GetAddress when the accesssbility
bus doesn't exist. Make sure to cache a non-existent accessibility
bus by setting the "" string.

gtk/a11y/gtkatspicontext.c

index 4981ef269af3e6d0eab7fadd9743f7b0006a35ac..9840e731b4876e946fdd41cc28997b535db052fa 100644 (file)
@@ -1732,6 +1732,12 @@ get_bus_address (GdkDisplay *display)
 #endif
 
 out:
+
+  if (bus_address == NULL)
+    g_object_set_data_full (G_OBJECT (display), "-gtk-atspi-bus-address",
+                            g_strdup (""),
+                            g_free);
+
   return bus_address;
 }