From 81521787c6dc9d2afe36345712c2538436b65e6d Mon Sep 17 00:00:00 2001 From: JunsuChoi Date: Fri, 12 Jan 2018 16:38:36 +0900 Subject: [PATCH] atspi: do not demote an object that repeats event. If an object is registered to elm_access, then do not demote its order even though the object repeats event(repeat_events: 1) when _sort_by_repeat_events function sorts object order. User could add a rectangle to give accessibility. If the rectangle does not repeat events, then it would be a problem when screen reader is off. atspi: fix compare func to find object at point 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 commit: 13c423e081c9ee3c1cac4a1d621479d421dd9294 Change-Id: I9348a10cdd3fde93c4a833b535c1c50cc7a859c5 --- src/lib/elementary/efl_ui_widget.c | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index 462ad26..2b762f7 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -6948,12 +6948,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); - if (repeat1 != repeat2 && repeat1 == EINA_TRUE) return 1; + if (repeat1 != repeat2) + { + if (repeat1 && !ao1) return 1; + } + else + { + if (repeat1 && !ao1 && ao2) return 1; + } + return -1; } -- 2.7.4