From: Padraig O'Briain Date: Fri, 7 Mar 2003 08:36:20 +0000 (+0000) Subject: Add check that role is actually being changed. Do not emit notification X-Git-Tag: ATK_1_3_0~6 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0972993284cf2c84d09d5ffea2d473c4ce499319;p=platform%2Fupstream%2Fatk.git Add check that role is actually being changed. Do not emit notification 2003-03-07 Padraig O'Briain * atk/atkobject.c (atk_object_set_role): Add check that role is actually being changed. Do not emit notification for initial role setting. (bug #107710) --- diff --git a/ChangeLog b/ChangeLog index 47de5db..35c2629 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +2003-03-07 Padraig O'Briain + + * atk/atkobject.c (atk_object_set_role): Add check that role is + actually being changed. Do not emit notification for initial + role setting. (bug #107710) + 2003-03-06 Padraig O'Briain * atk/atkrelationset.c: Current returning of FALSE to 0 in function diff --git a/atk/atkobject.c b/atk/atkobject.c index c63c7ef..31bbc65 100755 --- a/atk/atkobject.c +++ b/atk/atkobject.c @@ -762,14 +762,21 @@ atk_object_set_role (AtkObject *accessible, AtkRole role) { AtkObjectClass *klass; + AtkRole old_role; g_return_if_fail (ATK_IS_OBJECT (accessible)); klass = ATK_OBJECT_GET_CLASS (accessible); if (klass->set_role) { - (klass->set_role) (accessible, role); - g_object_notify (G_OBJECT (accessible), atk_object_name_property_role); + old_role = atk_object_get_role (accessible); + if (old_role != role) + { + (klass->set_role) (accessible, role); + if (old_role != ATK_ROLE_UNKNOWN) + /* Do not notify for initial role setting */ + g_object_notify (G_OBJECT (accessible), atk_object_name_property_role); + } } }