elm_widget: update child object focus_order.
authorUmesh Tanwar <umesh.tanwar@samsung.com>
Fri, 18 Mar 2016 18:56:59 +0000 (11:56 -0700)
committerCedric Bail <cedric@osg.samsung.com>
Fri, 18 Mar 2016 18:58:02 +0000 (11:58 -0700)
Summary:
_parent_focus() when called recursively updates the
sd->focus_order for parent obeject only. The sibling's sd->focus_order
not get updated.
So updated the focus_order for siblings.

Signed-off-by: Umesh Tanwar <umesh.tanwar@samsung.com>
Test Plan:
{F30149}
correct case:
1. Press Enter key on click button. A popoup will come.
2. Pressing enter key on popup button the popup hides and focus goes back to click button.

issue case:
1. Press Enter key on click button. A popoup will come.
2. press Alt+tab twice.
3. Pressing enter key on popup button the popup hides and focus does not go back to click button.

Reviewers: raster, cedric

Subscribers: singh.amitesh

Differential Revision: https://phab.enlightenment.org/D3807

legacy/elementary/src/lib/elm_widget.c

index b110f32..4121519 100644 (file)
@@ -792,6 +792,27 @@ _elm_widget_focus_highlight_style_get(Eo *obj EINA_UNUSED, Elm_Widget_Smart_Data
 }
 
 static void
+_child_focus_order_update(Evas_Object* parent, Evas_Object* obj)
+{
+   const Eina_List *l;
+   Evas_Object *child;
+   ELM_WIDGET_DATA_GET(parent, sdp);
+   EINA_LIST_FOREACH(sdp->subobjs, l, child)
+     {
+        if (!_elm_widget_is(child) || (child == obj)) continue;
+       ELM_WIDGET_DATA_GET(child,sdc);
+   
+        if(sdc->can_focus || (sdc->child_can_focus))
+         {
+             focus_order++;
+            sdc->focus_order = focus_order;
+          }
+       _child_focus_order_update(child, NULL);
+     }
+       
+}
+
+static void
 _parent_focus(Evas_Object *obj, Elm_Object_Item *item)
 {
    API_ENTRY return;
@@ -820,6 +841,8 @@ _parent_focus(Evas_Object *obj, Elm_Object_Item *item)
 
    if (_elm_config->access_mode == ELM_ACCESS_MODE_ON)
      _elm_access_highlight_set(obj);
+
+   if (o) _child_focus_order_update(o, obj);
 }
 
 static void