From f777e2a3f3e4f2928d7aba5a7148778d5af055e4 Mon Sep 17 00:00:00 2001 From: Carsten Haitzler Date: Tue, 21 Feb 2012 10:54:46 +0000 Subject: [PATCH] use focus order to determine if window never focused before instead of show count. fixes focus problems in elm tests for entries SVN revision: 68211 --- src/lib/elm_widget.c | 8 +++++++- src/lib/elm_widget.h | 1 + src/lib/elm_win.c | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c index 240f5cf..ab99066 100644 --- a/src/lib/elm_widget.c +++ b/src/lib/elm_widget.c @@ -2778,6 +2778,13 @@ elm_widget_focus_disabled_handle(Evas_Object *obj) elm_widget_focus_tree_unfocusable_handle(obj); } +EAPI unsigned int +elm_widget_focus_order_get(const Evas_Object *obj) +{ + API_ENTRY return 0; + if (sd->focus_order) return sd->focus_order; +} + /** * @internal * @@ -3478,7 +3485,6 @@ _elm_widget_item_access_info_set(Elm_Widget_Item *item, const char *txt) else item->access_info = eina_stringshare_add(txt); } - static void _smart_add(Evas_Object *obj) { diff --git a/src/lib/elm_widget.h b/src/lib/elm_widget.h index ccba907..721d653 100644 --- a/src/lib/elm_widget.h +++ b/src/lib/elm_widget.h @@ -428,6 +428,7 @@ EAPI void elm_widget_focus_hide_handle(Evas_Object *obj); EAPI void elm_widget_focus_mouse_up_handle(Evas_Object *obj); EAPI void elm_widget_focus_tree_unfocusable_handle(Evas_Object *obj); EAPI void elm_widget_focus_disabled_handle(Evas_Object *obj); +EAPI unsigned int elm_widget_focus_order_get(const Evas_Object *obj); EAPI void elm_widget_text_part_set(Evas_Object *obj, const char *part, const char *label); EAPI const char *elm_widget_text_part_get(const Evas_Object *obj, const char *part); EAPI void elm_widget_domain_translatable_text_part_set(Evas_Object *obj, const char *part, const char *domain, const char *text); diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c index d53ee80..34db304 100644 --- a/src/lib/elm_win.c +++ b/src/lib/elm_win.c @@ -337,7 +337,7 @@ _elm_win_focus_in(Ecore_Evas *ee) win = elm_widget_data_get(obj); if (!win) return; _elm_widget_top_win_focused_set(win->win_obj, EINA_TRUE); - if (win->show_count == 1) + if (!elm_widget_focus_order_get(obj)) { elm_widget_focus_steal(win->win_obj); win->show_count++; -- 2.7.4