summaryrefslogtreecommitdiff
path: root/atk/atkobject.c
diff options
context:
space:
mode:
authorPadraig O'Briain <padraig.obriain@sun.com>2003-04-15 16:33:31 +0000
committerPadraig O'Briain <padraigo@src.gnome.org>2003-04-15 16:33:31 +0000
commit1e547c068693efa0ad6b8ab8c81667281c991fe5 (patch)
tree6fe9e09e5deb5c65a1c20346ef70d2c3e5b02a42 /atk/atkobject.c
parentc320420c069f455a9e7823a195cddc14e7603b6d (diff)
downloadatk-1e547c068693efa0ad6b8ab8c81667281c991fe5.tar.gz
Add check that role is actually being changed. Do not emit notificationATK_1_2_3
2003-04-15 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) * atk/atkgobjectaccessible.c (atk_gobject_accessible_from_object): Correct creation of non-AtkGObjectAccessible (bug #107124) * atk/atkobject.c (atk_object_class_init): Set default initialize function so that code which does not check for existence of parent class's initialize function will work.
Diffstat (limited to 'atk/atkobject.c')
-rwxr-xr-xatk/atkobject.c24
1 files changed, 20 insertions, 4 deletions
diff --git a/atk/atkobject.c b/atk/atkobject.c
index 0c9c220..d4634c4 100755
--- a/atk/atkobject.c
+++ b/atk/atkobject.c
@@ -1,5 +1,5 @@
/* ATK - Accessibility Toolkit
- * Copyright 2001 Sun Microsystems Inc.
+ * Copyright 2001, 2002, 2003 Sun Microsystems Inc.
*
* This library is free software; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
@@ -64,7 +64,8 @@ static void atk_object_init (AtkObject *accessible
AtkObjectClass *klass);
static AtkRelationSet* atk_object_real_ref_relation_set
(AtkObject *accessible);
-
+static void atk_object_real_initialize (AtkObject *accessible,
+ gpointer data);
static void atk_object_real_set_property (GObject *object,
guint prop_id,
const GValue *value,
@@ -168,6 +169,7 @@ atk_object_class_init (AtkObjectClass *klass)
klass->get_role = atk_object_real_get_role;
klass->get_layer = atk_object_real_get_layer;
klass->get_mdi_zorder = NULL;
+ klass->initialize = atk_object_real_initialize;
klass->ref_state_set = atk_object_real_ref_state_set;
klass->set_name = atk_object_real_set_name;
klass->set_description = atk_object_real_set_description;
@@ -743,14 +745,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);
+ }
}
}
@@ -1533,3 +1542,10 @@ atk_object_remove_relationship (AtkObject *object,
return ret;
}
+
+static void
+atk_object_real_initialize (AtkObject *accessible,
+ gpointer data)
+{
+ return;
+}