From 80d3c912259746251bb90d3035079dc71030f82d Mon Sep 17 00:00:00 2001 From: Shinwoo Kim Date: Thu, 15 Jun 2017 21:29:03 +0900 Subject: [PATCH] Add NEIGHBOR_SEARCH_MODE_RECURSE_TO_OUTSIDE mode The "GetNeighbor" method returns an accessible object which has same bus with root object. But the returned recurse value is 1. The following is the case. If embedded object has highlight, and there is no more previous object, then it returns PROXY object which has embedding side bus information. In this case, the "GetNeighbor" should find previous sibling object in embedding process. The "GetNeighbor" is using NEIGHBOR_SEARCH_MODE_RECURSE_TO_OUTSIDE for this case. Change-Id: Icae2709b2746bd970643034c2d66b1c196c65ca9 --- atspi/atspi-accessible.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/atspi/atspi-accessible.c b/atspi/atspi-accessible.c index bafe114..40053f2 100644 --- a/atspi/atspi-accessible.c +++ b/atspi/atspi-accessible.c @@ -583,6 +583,7 @@ typedef enum { NEIGHBOR_SEARCH_MODE_NORMAL = 0, NEIGHBOR_SEARCH_MODE_RECURSE_FROM_ROOT = 1, NEIGHBOR_SEARCH_MODE_CONTINUE_AFTER_FAILED_RECURSING = 2, + NEIGHBOR_SEARCH_MODE_RECURSE_TO_OUTSIDE = 3, } GetNeighborSearchMode; /** * atspi_accessible_get_neighbor: @@ -630,10 +631,17 @@ atspi_accessible_get_neighbor (AtspiAccessible *root, // thus we're recursing. should the recurse failed to find anything it will end with if (ret && recurse) { g_object_unref(G_OBJECT(start)); - g_queue_push_tail(children_root_stack, ret); start = ret; g_object_ref(start); - search_mode = NEIGHBOR_SEARCH_MODE_RECURSE_FROM_ROOT; + if (are_objects_on_the_same_bus(root, ret)) + { + search_mode = NEIGHBOR_SEARCH_MODE_RECURSE_TO_OUTSIDE; + } + else + { + g_queue_push_tail(children_root_stack, ret); + search_mode = NEIGHBOR_SEARCH_MODE_RECURSE_FROM_ROOT; + } continue; } // found the one we've been looking for -- 2.7.4