From f9e9fe4e19ea5d292413611ecd1a1d2bc19d5018 Mon Sep 17 00:00:00 2001 From: woohyun Date: Wed, 7 Sep 2011 06:15:55 +0000 Subject: [PATCH] elementary : Elementary focus can be controlled only when top window's canvas gets focus. If elementary's focus control is tried with unfocused canvas, newest_focus_count is only updated. git-svn-id: https://svn.enlightenment.org/svn/e/trunk/elementary@63245 7cbeb6ba-43b4-40fd-8cce-4c39aea84d33 --- src/lib/elm_widget.c | 24 ++++++++++++++++++++++++ src/lib/elm_win.c | 2 +- 2 files changed, 25 insertions(+), 1 deletion(-) diff --git a/src/lib/elm_widget.c b/src/lib/elm_widget.c index 0e89c2a..d88c1a3 100644 --- a/src/lib/elm_widget.c +++ b/src/lib/elm_widget.c @@ -1983,6 +1983,30 @@ _elm_widget_top_win_focused_get(const Evas_Object *obj) return sd->top_win_focused; } +void +_elm_widget_top_win_focused_set(Evas_Object *obj, Eina_Bool top_win_focused) +{ + const Eina_List *l; + Evas_Object *child; + API_ENTRY return; + + if (sd->top_win_focused == top_win_focused) return; + if (sd->resize_obj) + _elm_widget_top_win_focused_set(sd->resize_obj, top_win_focused); + EINA_LIST_FOREACH(sd->subobjs, l, child) + { + _elm_widget_top_win_focused_set(child, top_win_focused); + } + sd->top_win_focused = top_win_focused; +} + +Eina_Bool +_elm_widget_top_win_focused_get(const Evas_Object *obj) +{ + API_ENTRY return EINA_FALSE; + return sd->top_win_focused; +} + EAPI void elm_widget_activate(Evas_Object *obj) { diff --git a/src/lib/elm_win.c b/src/lib/elm_win.c index 837b2f3..87001f0 100644 --- a/src/lib/elm_win.c +++ b/src/lib/elm_win.c @@ -337,7 +337,7 @@ _elm_win_focus_out(Ecore_Evas *ee) if (!obj) return; win = elm_widget_data_get(obj); if (!win) return; - elm_object_unfocus(win->win_obj); + elm_object_focus_set(win->win_obj, EINA_FALSE); _elm_widget_top_win_focused_set(win->win_obj, EINA_FALSE); evas_object_smart_callback_call(win->win_obj, SIG_FOCUS_OUT, NULL); win->focus_highlight.cur.visible = EINA_FALSE; -- 2.7.4