From c35d5ac903a6156abff0be0c966d2484e70f70bd Mon Sep 17 00:00:00 2001 From: ChunEon Park Date: Fri, 6 Apr 2012 06:19:16 +0000 Subject: [PATCH] elementary/win - [E-devel] [Patch][Elementary] Patch for elm_win to fix the focus chain issue in case of a widget added as a normal sub-object, not a resizable object Current Issue: Currently when we add a widget to window as a sub-object, e.g. elm_notify_add(win) which internally calls elm_widget_sub_object_add then the focus chain using includes only the first focusable subitem of the widget, not all. Whereas with elm_win_resize_object_add, it works fine and cycles to all focusable sub-items of the widget. Reason: The reason is that we are appending sub-object to the list in elm_win which is used for focus chain, only in case of elm_win_resize_object_add. Change Description: Added a new API: EAPI Eina_List *elm_widget_sub_object_list_get(const Evas_Object *obj); This API returns the list of sub-objects of an elementary widget (sd->subobjs) where sd is Smart_Data pointer obtainted using elm_widget_smart_data_get(obj). We have used this API in elm_win for focus_next_hook implementation. Signed-Off-By: RAJEEV RANJAN@samsumg.com> SVN revision: 69943 --- legacy/elementary/src/lib/elm_widget.c | 7 +++++++ legacy/elementary/src/lib/elm_widget.h | 1 + legacy/elementary/src/lib/elm_win.c | 9 +++++---- 3 files changed, 13 insertions(+), 4 deletions(-) diff --git a/legacy/elementary/src/lib/elm_widget.c b/legacy/elementary/src/lib/elm_widget.c index 4483c2fe9f..53d9d6e601 100644 --- a/legacy/elementary/src/lib/elm_widget.c +++ b/legacy/elementary/src/lib/elm_widget.c @@ -1036,6 +1036,13 @@ elm_widget_sub_object_del(Evas_Object *obj, evas_object_smart_callback_call(obj, "sub-object-del", sobj); } +EAPI const Eina_List * +elm_widget_sub_object_list_get(const Evas_Object *obj) +{ + API_ENTRY return NULL; + return (const Eina_List *)sd->subobjs; +} + EAPI void elm_widget_resize_object_set(Evas_Object *obj, Evas_Object *sobj) diff --git a/legacy/elementary/src/lib/elm_widget.h b/legacy/elementary/src/lib/elm_widget.h index 11b20f42c0..f8db35c643 100644 --- a/legacy/elementary/src/lib/elm_widget.h +++ b/legacy/elementary/src/lib/elm_widget.h @@ -328,6 +328,7 @@ EAPI void elm_widget_data_set(Evas_Object *obj, void *data); EAPI void *elm_widget_data_get(const Evas_Object *obj); EAPI void elm_widget_sub_object_add(Evas_Object *obj, Evas_Object *sobj); EAPI void elm_widget_sub_object_del(Evas_Object *obj, Evas_Object *sobj); +EAPI const Eina_List *elm_widget_sub_object_list_get(const Evas_Object *obj); EAPI void elm_widget_resize_object_set(Evas_Object *obj, Evas_Object *sobj); EAPI void elm_widget_hover_object_set(Evas_Object *obj, Evas_Object *sobj); EAPI void elm_widget_signal_emit(Evas_Object *obj, const char *emission, const char *source); diff --git a/legacy/elementary/src/lib/elm_win.c b/legacy/elementary/src/lib/elm_win.c index 44bd6d9101..0130349d3c 100644 --- a/legacy/elementary/src/lib/elm_win.c +++ b/legacy/elementary/src/lib/elm_win.c @@ -498,19 +498,20 @@ _elm_win_focus_next_hook(const Evas_Object *obj, Elm_Focus_Direction dir, Evas_O { Elm_Win *wd = elm_widget_data_get(obj); const Eina_List *items; + const Eina_List *list; void *(*list_data_get) (const Eina_List *list); if (!wd) return EINA_FALSE; + list = elm_widget_sub_object_list_get(obj); /* Focus chain */ - if (wd->subobjs) + if (list) { if (!(items = elm_widget_focus_custom_chain_get(obj))) { - items = wd->subobjs; - if (!items) - return EINA_FALSE; + if (!list) return EINA_FALSE; + items = list; } list_data_get = eina_list_data_get;