From 01f5a3d712ef0db6ebbcac2feae900525d8e708a Mon Sep 17 00:00:00 2001 From: WooHyun Jung Date: Tue, 7 May 2013 21:00:57 +0900 Subject: [PATCH] [elm_widget] Focus cannot be stolen when one of parents is invisible or disabled. --- src/lib/elm_widget.c | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c index 754d941..f1f8640 100644 --- a/src/lib/elm_widget.c +++ b/src/lib/elm_widget.c @@ -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))) -- 2.7.4