summaryrefslogtreecommitdiff
path: root/atspi/atspi-accessible.c
diff options
context:
space:
mode:
authorMike Gorse <mgorse@novell.com>2011-04-18 05:07:14 -0500
committerMike Gorse <mgorse@novell.com>2011-04-18 05:07:14 -0500
commitf2d5fab0b2d7802723b9104f3abd57bb30dd2a66 (patch)
treea93ea6c44276134ad35d102875a4f563967f2173 /atspi/atspi-accessible.c
parent86712069170f02f4466d209dc7214f59e662b095 (diff)
downloadat-spi2-core-f2d5fab0b2d7802723b9104f3abd57bb30dd2a66.tar.gz
Fix for BGO#648059: get_application should return something w/ROLE_APPLICATION
atspi_accessible_get_application will walk up the tree until it finds a child of the desktop, but this causes it to return the wrong accessible if an object's parent is set to NULL for whatever reason, so check for this and return the object's root accessible in that case.
Diffstat (limited to 'atspi/atspi-accessible.c')
-rw-r--r--atspi/atspi-accessible.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/atspi/atspi-accessible.c b/atspi/atspi-accessible.c
index 05d2e16b..86f47d85 100644
--- a/atspi/atspi-accessible.c
+++ b/atspi/atspi-accessible.c
@@ -719,6 +719,16 @@ atspi_accessible_get_application (AtspiAccessible *obj, GError **error)
for (;;)
{
parent = atspi_accessible_get_parent (obj, NULL);
+ if (!parent &&
+ atspi_accessible_get_role (obj, NULL) != ATSPI_ROLE_APPLICATION)
+ {
+ AtspiAccessible *root = g_object_ref (obj->parent.app->root);
+ if (root)
+ {
+ g_object_unref (obj);
+ return root;
+ }
+ }
if (!parent || parent == obj ||
atspi_accessible_get_role (parent, NULL) == ATSPI_ROLE_DESKTOP_FRAME)
return obj;