diff options
author | Padraig O'Briain <padraig.obriain@sun.com> | 2003-03-07 08:36:20 +0000 |
---|---|---|
committer | Padraig O'Briain <padraigo@src.gnome.org> | 2003-03-07 08:36:20 +0000 |
commit | 0972993284cf2c84d09d5ffea2d473c4ce499319 (patch) | |
tree | 34545a1f1a2707e414a6d6434a1e9345d6580da3 /atk | |
parent | ad0d2b038d061a0b5933a35ecce0fc9a87cf4ec2 (diff) | |
download | atk-0972993284cf2c84d09d5ffea2d473c4ce499319.tar.gz |
Add check that role is actually being changed. Do not emit notification
2003-03-07 Padraig O'Briain <padraig.obriain@sun.com>
* 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)
Diffstat (limited to 'atk')
-rwxr-xr-x | atk/atkobject.c | 11 |
1 files changed, 9 insertions, 2 deletions
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); + } } } |