From 4fb7478716dc0ad240bfb728570bf1b66e03e8c3 Mon Sep 17 00:00:00 2001 From: WooHyun Jung Date: Tue, 7 May 2013 19:15:44 +0900 Subject: [PATCH] elementary/elm_widget : Focus cannot be stolen when one of parents is invisible or disabled. --- ChangeLog | 4 ++++ NEWS | 1 + src/lib/elm_widget.c | 15 ++++++++++----- 3 files changed, 15 insertions(+), 5 deletions(-) diff --git a/ChangeLog b/ChangeLog index 28bf77b..1958ff6 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1340,3 +1340,7 @@ 2013-05-06 WooHyun Jung * Add elm_entry smart callback - "text,set,done". + +2013-05-07 WooHyun Jung + + * Focus cannot be stolen when one of parents is invisible or disabled. diff --git a/NEWS b/NEWS index ebb3f6a..d86ccbf 100644 --- a/NEWS +++ b/NEWS @@ -227,6 +227,7 @@ Fixes: * Fix gengrid does not work under the accessibility. * Fix do not append NULL to genlist focus list. * Fix elm_clock_first_interval_set writes wrong value. + * Focus cannot be stolen when one of parents is invisible or disabled. Removals: diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c index 9463e77..4834fee 100644 --- a/src/lib/elm_widget.c +++ b/src/lib/elm_widget.c @@ -3198,15 +3198,20 @@ _elm_widget_focus_steal(Eo *obj, void *_pd, va_list *list EINA_UNUSED) 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 = eo_data_scope_get(o, MY_CLASS); 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