summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPadraig O'Briain <padraig.obriain@sun.com>2003-03-07 08:36:20 +0000
committerPadraig O'Briain <padraigo@src.gnome.org>2003-03-07 08:36:20 +0000
commit0972993284cf2c84d09d5ffea2d473c4ce499319 (patch)
tree34545a1f1a2707e414a6d6434a1e9345d6580da3
parentad0d2b038d061a0b5933a35ecce0fc9a87cf4ec2 (diff)
downloadatk-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)
-rw-r--r--ChangeLog6
-rwxr-xr-xatk/atkobject.c11
2 files changed, 15 insertions, 2 deletions
diff --git a/ChangeLog b/ChangeLog
index 47de5db..35c2629 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+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)
+
2003-03-06 Padraig O'Briain <padraig.obriain@sun.com>
* 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);
+ }
}
}