woohyun pushed a commit to branch master.

commit 3654d6e28137cfaf72444d5c5e26b651fabac89e
Author: WooHyun Jung <[email protected]>
Date:   Tue May 7 20:41:32 2013 +0900

    elementary/elm_widget : Fixed wrong logic when setting parent's 
child_can_focus as EINA_TRUE.
---
 src/lib/elm_widget.c | 27 ++++++++++++---------------
 1 file changed, 12 insertions(+), 15 deletions(-)

diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c
index 89f41c4..c941497 100644
--- a/src/lib/elm_widget.c
+++ b/src/lib/elm_widget.c
@@ -1279,6 +1279,18 @@ _elm_widget_can_focus_set(Eo *obj, void *_pd, va_list 
*list)
    sd->can_focus = can_focus;
    if (sd->can_focus)
      {
+        /* update child_can_focus of parents */
+        Evas_Object *o = obj;
+
+        for (;;)
+          {
+             o = elm_widget_parent_get(o);
+             if (!o) break;
+             sd = eo_data_scope_get(o, MY_CLASS);
+             if (!sd || sd->child_can_focus) break;
+             sd->child_can_focus = EINA_TRUE;
+          }
+
         evas_object_event_callback_add(obj, EVAS_CALLBACK_KEY_DOWN,
                                        _propagate_event,
                                        (void *)(long)EVAS_CALLBACK_KEY_DOWN);
@@ -1288,21 +1300,6 @@ _elm_widget_can_focus_set(Eo *obj, void *_pd, va_list 
*list)
         evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_WHEEL,
                                        _propagate_event,
                                        (void 
*)(long)EVAS_CALLBACK_MOUSE_WHEEL);
-
-        /* update child focusable-ness on parents, now that a
-         * focusable child got in */
-        Elm_Widget_Smart_Data *sdp = sd;
-        if (!sdp->child_can_focus)
-          {
-             sdp->child_can_focus = EINA_TRUE;
-             while (sdp->parent_obj)
-               {
-                  if (sdp->child_can_focus) break;
-
-                  sdp->child_can_focus = EINA_TRUE;
-                  sdp = eo_data_scope_get(sdp->parent_obj, MY_CLASS);
-               }
-          }
      }
    else
      {

-- 

------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and 
their applications. This 200-page book is written by three acclaimed 
leaders in the field. The early access version is available now. 
Download your free book today! http://p.sf.net/sfu/neotech_d2d_may

Reply via email to