Update cache in response to role change notifications
authorMike Gorse <mgorse@suse.com>
Fri, 5 Oct 2012 21:40:55 +0000 (17:40 -0400)
committerMike Gorse <mgorse@suse.com>
Fri, 5 Oct 2012 21:40:55 +0000 (17:40 -0400)
We update the cache in response to name, description, and parent
property-change signals, but we were missing code to handle signals for
role changes.

https://bugzilla.gnome.org/show_bug.cgi?id=685469

atspi/atspi-event-listener.c

index 6e70318..26f1105 100644 (file)
@@ -270,6 +270,18 @@ cache_process_property_change (AtspiEvent *event)
       event->source->cached_properties &= ~ATSPI_CACHE_DESCRIPTION;
     }
   }
+  else if (!strcmp (event->type, "object:property-change:accessible-role"))
+  {
+    if (G_VALUE_HOLDS_INT (&event->any_data))
+    {
+      event->source->role = g_value_get_int (&event->any_data);
+      _atspi_accessible_add_cache (event->source, ATSPI_CACHE_ROLE);
+    }
+    else
+    {
+      event->source->cached_properties &= ~ATSPI_CACHE_ROLE;
+    }
+  }
 }
 
 static void