summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-11-13 09:33:28 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2018-11-20 20:50:42 +0100
commit9c1c35b9b878243d1952f328c415860fde43f21f (patch)
treee55a1112d16d7fa3fc2bc207ceb026b46ece4fc6
parentd79db7c8bf7d925db9f2e1a78ad8082674b9b71d (diff)
downloadefl-9c1c35b9b878243d1952f328c415860fde43f21f.tar.gz
elm_legacy: use the new api
with using the new api of efl.ui.focus.object we can resolve a bug that was pointed out in P243. Differential Revision: https://phab.enlightenment.org/D7267
-rw-r--r--src/lib/elementary/elm_focus_legacy.c28
1 files changed, 1 insertions, 27 deletions
diff --git a/src/lib/elementary/elm_focus_legacy.c b/src/lib/elementary/elm_focus_legacy.c
index e3de5a97a6..15da74aadc 100644
--- a/src/lib/elementary/elm_focus_legacy.c
+++ b/src/lib/elementary/elm_focus_legacy.c
@@ -277,38 +277,12 @@ elm_object_focused_object_get(const Evas_Object *obj)
EAPI Eina_Bool
elm_object_focus_get(const Evas_Object *obj)
{
- Efl_Ui_Focus_Manager *m;
- Efl_Ui_Focus_Object *focused_child;
API_ENTRY_VAL(EINA_FALSE)
if (!elm_widget_is(obj))
return evas_object_focus_get(obj);
- m = efl_ui_focus_object_focus_manager_get(obj);
-
- //no manager means not registered
- if (!m) return EINA_FALSE;
-
- //assertion: our redirect manager m is in the redirect chain
- m = efl_ui_focus_object_focus_manager_get(obj);
-
- //if obj is the redriect manager its kind of focused
- if (efl_ui_focus_manager_redirect_get(m) == obj) return EINA_TRUE;
-
- //if there is a redirect manager
- if (!!efl_ui_focus_manager_redirect_get(m)) return EINA_FALSE;
-
- //now take the focused object and walk down the parents, if this is
- focused_child = efl_ui_focus_manager_focus_get(m);
-
- while(focused_child)
- {
- if (focused_child == obj) return EINA_TRUE;
-
- focused_child = efl_ui_focus_object_focus_parent_get(focused_child);
- }
-
- return efl_ui_focus_object_focus_get(obj);
+ return _elm_widget_top_win_focused_get(obj) && (efl_ui_focus_object_child_focus_get(obj) | efl_ui_focus_object_focus_get(obj));
}
EAPI void