[at-spi2-atk] Only send cache-related events for transients when explicitly requested
- From: Mike Gorse <mgorse src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [at-spi2-atk] Only send cache-related events for transients when explicitly requested
- Date: Mon, 28 Apr 2014 23:48:53 +0000 (UTC)
commit c8c5b688e57d0da1fd2d50b5f4c13414ac1021f7
Author: Mike Gorse <mgorse suse com>
Date: Mon Apr 21 18:08:19 2014 -0500
Only send cache-related events for transients when explicitly requested
Hopefully this will improve performance when, ie, gtk floods us with
children-changed events when populating a large treeview.
https://bugzilla.gnome.org/show_bug.cgi?id=728319
atk-adaptor/event.c | 19 +++++++++++++++----
1 files changed, 15 insertions(+), 4 deletions(-)
---
diff --git a/atk-adaptor/event.c b/atk-adaptor/event.c
index 0430271..42d359d 100644
--- a/atk-adaptor/event.c
+++ b/atk-adaptor/event.c
@@ -376,8 +376,8 @@ append_properties (GArray *properties, event_data *evdata)
}
static gboolean
-signal_is_needed (const gchar *klass, const gchar *major, const gchar *minor,
- GArray **properties)
+signal_is_needed (AtkObject *obj, const gchar *klass, const gchar *major,
+ const gchar *minor, GArray **properties)
{
gchar *data [4];
event_data *evdata;
@@ -403,7 +403,18 @@ signal_is_needed (const gchar *klass, const gchar *major, const gchar *minor,
!g_strcmp0 (data [2], "accessible-parent") ||
!g_strcmp0 (data [2], "accessible-role"))) ||
!g_strcmp0 (data [1], "StateChanged"))
- ret = TRUE;
+ {
+ if (minor && !g_strcmp0 (minor, "defunct"))
+ ret = TRUE;
+ else
+ {
+ AtkStateSet *set = atk_object_ref_state_set (obj);
+ AtkState state = ((!g_strcmp0 (data[1], "ChildrenChanged")) ?
+ ATK_STATE_MANAGES_DESCENDANTS : ATK_STATE_TRANSIENT);
+ ret = !atk_state_set_contains_state (set, state);
+ g_object_unref (set);
+ }
+ }
/* Hack: events such as "object::text-changed::insert:system" as
generated by Gecko */
@@ -483,7 +494,7 @@ emit_event (AtkObject *obj,
if (!minor) minor = "";
if (!type) type = "u";
- if (!signal_is_needed (klass, major, minor, &properties))
+ if (!signal_is_needed (obj, klass, major, minor, &properties))
return;
path = spi_register_object_to_path (spi_global_register, G_OBJECT (obj));
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]