atspi: enhance _accessible_at_point_top_down_get 32/149332/1
authorShinwoo Kim <cinoo.kim@samsung.com>
Tue, 12 Sep 2017 05:44:39 +0000 (14:44 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Tue, 12 Sep 2017 05:52:03 +0000 (14:52 +0900)
If there is only one valid child at point, then return it.
The evas_tree_objects_at_xy_get could not find proper object,
if application does not have well aligned objects.

This could be a role of application, but this patch set could solve somehow.

Change-Id: I6326a23b88904f6003a99e8b17885452890c7222

src/lib/elm_widget.c

index 2f7967f9c92fa80c0b24677731096523c9696443..152a2f9263d5732ab41e7d19c031a70013120ef4 100644 (file)
@@ -7372,6 +7372,17 @@ _accessible_at_point_top_down_get(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSE
         if (_is_inside(child, x, y) && _is_acceptable_leaf(child))
           valid_children = eina_list_append(valid_children, child);
      }
+
+   /* If there is only one valid child at point, then return it.
+      The evas_tree_objects_at_xy_get could not find proper object,
+      if application does not have well aligned objects. */
+   if (eina_list_count(valid_children) == 1)
+     {
+        eina_list_free(children);
+        child = eina_list_nth(valid_children, 0);
+        return child;
+     }
+
    /* Get evas_object stacked at given x,y coordinates starting from top */
    Eina_List *stack = evas_tree_objects_at_xy_get(evas_object_evas_get(obj), NULL, x, y);
    /* Foreach stacked object starting from top */