cedric pushed a commit to branch master.
http://git.enlightenment.org/core/efl.git/commit/?id=790843117800171d08c667f65f0256c9a5499392
commit 790843117800171d08c667f65f0256c9a5499392
Author: soohye <soohye.s...@samsung.com>
Date: Wed Jun 22 16:55:07 2016 -0700
elementary/scroller: fix to skip focus for unfocusable scroller
Summary:
There is a issue about passing the focus to unfocusable scroller.
To prevent the issue, check the status of focusable object and child object
before passing the focus.
Test Plan:
{F38439}
I changed the test file.
The problem occured as below.
1. click button
2. show popup
3. click cancel button in popup
4. lost the focus
Reviewers: Hermet, raster, cedric
Reviewed By: cedric
Subscribers: minkyu, sju27, cedric, jpeg
Differential Revision: https://phab.enlightenment.org/D4056
Signed-off-by: Cedric BAIL <ced...@osg.samsung.com>
---
src/bin/elementary/test.c | 2 +
src/bin/elementary/test_scroller.c | 100 +
src/lib/elementary/elm_scroller.c | 4 ++
3 files changed, 106 insertions(+)
diff --git a/src/bin/elementary/test.c b/src/bin/elementary/test.c
index 78609fd..c9c2596 100644
--- a/src/bin/elementary/test.c
+++ b/src/bin/elementary/test.c
@@ -165,6 +165,7 @@ void test_scroller(void *data, Evas_Object *obj, void
*event_info);
void test_scroller2(void *data, Evas_Object *obj, void *event_info);
void test_scroller3(void *data, Evas_Object *obj, void *event_info);
void test_scroller4(void *data, Evas_Object *obj, void *event_info);
+void test_scroller5(void *data, Evas_Object *obj, void *event_info);
void test_spinner(void *data, Evas_Object *obj, void *event_info);
void test_index(void *data, Evas_Object *obj, void *event_info);
void test_index2(void *data, Evas_Object *obj, void *event_info);
@@ -803,6 +804,7 @@ add_tests:
ADD_TEST(NULL, "Scroller", "Scroller 2", test_scroller2);
ADD_TEST(NULL, "Scroller", "Scroller 3", test_scroller3);
ADD_TEST(NULL, "Scroller", "Page Scroller", test_scroller4);
+ ADD_TEST(NULL, "Scroller", "Scroller on Popup", test_scroller5);
//--//
// FIXME: add frame test
diff --git a/src/bin/elementary/test_scroller.c
b/src/bin/elementary/test_scroller.c
index eb00f25..2221f80 100644
--- a/src/bin/elementary/test_scroller.c
+++ b/src/bin/elementary/test_scroller.c
@@ -728,3 +728,103 @@ test_scroller4(void *data EINA_UNUSED, Evas_Object *obj
EINA_UNUSED, void *event
evas_object_resize(win, 400, 550);
evas_object_show(win);
}
+
+static void
+_popup_btn_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void
*event_info EINA_UNUSED)
+{
+ evas_object_del(data);
+}
+
+static void
+_block_clicked_cb(void *data EINA_UNUSED, Evas_Object *obj, void *event_info
EINA_UNUSED)
+{
+ evas_object_del(obj);
+}
+
+static void
+_btn_clicked_cb(void *data, Evas_Object *obj EINA_UNUSED, void *event_info
EINA_UNUSED)
+{
+ Evas_Object *win = data;
+ Evas_Object *popup, *scr, *lbl, *btn, *rect, *tbl;
+
+ popup = elm_popup_add(win);
+ elm_object_part_text_set(popup, "title,text", "Scroller on Popup");
+ evas_object_smart_callback_add(popup, "block,clicked",
+ _block_clicked_cb, NULL);
+
+ tbl = elm_table_add(popup);
+ elm_object_content_set(popup, tbl);
+ evas_object_show(tbl);
+
+ rect = evas_object_rectangle_add(evas_object_evas_get(popup));
+ evas_object_size_hint_min_set(rect, 200, 50);
+ elm_table_pack(tbl, rect, 0, 0, 1, 1);
+
+ scr = elm_scroller_add(popup);
+ elm_object_focus_allow_set(scr, EINA_FALSE);
+ evas_object_size_hint_weight_set(scr, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(scr, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ evas_object_show(scr);
+
+ lbl = elm_label_add(scr);
+ elm_object_text_set(lbl,
+ "Do you want close the popup?"
+ "Please select cancel button"
+ "Do you wnat close the popup?"
+ "Please select cancel button");
+ evas_object_size_hint_weight_set(lbl, EVAS_HINT_EXPAND, EVAS_HINT_EXPAND);
+ evas_object_size_hint_align_set(lbl, EVAS_HINT_FILL, EVAS_HINT_FILL);
+ elm_object_content_set(scr, lbl);
+ evas_object_show(lbl);
+
+ elm_table_pack(tbl, scr, 0, 0, 1, 1);
+
+ btn = elm_button_add(popup);
+ elm_object_text_set(btn, "Cancel");
+ elm_object_part_content_set(popup, "button1", btn);
+ evas_object_smart_callback_add(btn, "clicked", _popup_btn_clicked_cb,
popup);
+ evas_object_show(btn);
+
+ evas_object_show(popup);
+ elm_object_focus_set(btn, EINA_TRUE);
+}
+
+static void
+_focused_cb(void *data EINA_UNUSED, Evas_