atspi: fix compare func to find object at point 85/133385/2
authorShinwoo Kim <cinoo.kim@samsung.com>
Mon, 5 Jun 2017 10:36:19 +0000 (19:36 +0900)
committerShinwoo Kim <cinoo.kim@samsung.com>
Wed, 28 Jun 2017 06:48:39 +0000 (06:48 +0000)
The compare function(_sort_by_repeat_events) does not change if two objects
repeat event(repeat_events: 1) even though the second object is registered to
elm_access. In this case the object could be demoted in the list, and it is not
possilbe to find the object by screen reader.

The following is the problem case:

[Before Sorting]
1. Object A (repeat_events: 1)
2. Object B (repeat_events: 1, is registred to elm_access)
3. Object C (repeat_events: 1)
4. Object D (repeat_events: 0)
5. Object E (repeat_events: 0)

[After Sorting] D - E - A - B -C

Change-Id: I5c566252507d8d6c5aac5759588cdd9e1468cd3e

src/lib/elm_widget.c

index 3d59bb5..1865edf 100644 (file)
@@ -7202,15 +7202,24 @@ _accessible_at_point_top_down_get(Eo *obj, Elm_Widget_Smart_Data *_pd EINA_UNUSE
 
 static int _sort_by_repeat_events(const void *data1, const void *data2)
 {
+   Evas_Object *ao1, *ao2;
    Eina_Bool repeat1, repeat2;
 
+   ao1 = elm_access_object_get(data1);
+   ao2 = elm_access_object_get(data2);
+
    repeat1 = evas_object_repeat_events_get(data1);
    repeat2 = evas_object_repeat_events_get(data2);
 
-   Evas_Object *ao = elm_access_object_get(data1);
-   if (ao) return -1;
+   if (repeat1 != repeat2)
+     {
+        if (repeat1 && !ao1) return 1;
+     }
+   else
+     {
+        if (repeat1 && !ao1 && ao2) return 1;
+     }
 
-   if (repeat1 != repeat2 && repeat1 == EINA_TRUE) return 1;
    return -1;
 }