[elm_widget] Focus cannot be stolen when one of parents is invisible or disabled.
authorWooHyun Jung <wh0705.jung@samsung.com>
Tue, 7 May 2013 12:00:57 +0000 (21:00 +0900)
committerSungho Kwak <sungho1.kwak@samsung.com>
Wed, 12 Jun 2013 04:55:12 +0000 (13:55 +0900)
src/lib/elm_widget.c

index 754d941..f1f8640 100644 (file)
@@ -2851,15 +2851,20 @@ elm_widget_focus_steal(Evas_Object *obj)
    if (sd->disabled) return;
    if (!sd->can_focus) return;
    if (sd->tree_unfocusable) return;
-   parent = obj;
+   parent2 = parent = obj;
    for (;; )
      {
-        o = elm_widget_parent_get(parent);
-        if (!o) break;
+        o = elm_widget_parent_get(parent2);
+        if (!o)
+          {
+             parent = parent2;
+             break;
+          }
+        if (!evas_object_visible_get(o)) return;
         sd = evas_object_smart_data_get(o);
         if (sd->disabled || sd->tree_unfocusable) return;
-        if (sd->focused) break;
-        parent = o;
+        if (sd->focused) parent = o;
+        parent2 = o;
      }
    if ((!elm_widget_parent_get(parent)) &&
        (!elm_widget_parent2_get(parent)))