summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2018-07-09 16:39:35 -0400
committerSangHyeon Jade Lee <sh10233.lee@samsung.com>2018-07-12 11:34:47 +0900
commitdfd53287486fcd0ec237d13e4d00257e6b080256 (patch)
treea10b7ce3e1c0ff025b0affe99ddbca037369c7ed
parentf9c2dfea6405c4e3492552fb32aeb6f43f25c67c (diff)
downloadefl-dfd53287486fcd0ec237d13e4d00257e6b080256.tar.gz
elm_focus_legacy: check if top is really a window
Summary: if not, things are going to fall apart, as manager_top then can be NULL or invalid. Top has to be a window element, if this is not the case, then the widget tree of the given widget is dangling somewhere in the void. Calculating the next object in there or even the active manager will result in errors, since the active manager is not really the active manager, but rather just a manager object somewhere in a danging widget subtree. Moving the focus into such a dangling widgettree might result in a stuck focus rect on this object, since the DFS of the focus manager implementation cannot backtrack anymore into the widgets that are still part of the widget graph. Depends on D6531 Reviewers: devilhorns, segfaultxavi, zmike Reviewed By: segfaultxavi Subscribers: cedric, #committers, zmike Tags: #efl Differential Revision: https://phab.enlightenment.org/D6532
-rw-r--r--src/lib/elementary/elm_focus_legacy.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/src/lib/elementary/elm_focus_legacy.c b/src/lib/elementary/elm_focus_legacy.c
index 7c8bbe7917..33046deb6c 100644
--- a/src/lib/elementary/elm_focus_legacy.c
+++ b/src/lib/elementary/elm_focus_legacy.c
@@ -184,6 +184,8 @@ elm_object_focus_next(Evas_Object *obj,
API_ENTRY()
top = elm_object_top_widget_get(obj);
+ EINA_SAFETY_ON_FALSE_RETURN(efl_isa(top, EFL_UI_WIN_CLASS));
+
manager_top = efl_ui_focus_util_active_manager(EFL_UI_FOCUS_UTIL_CLASS, obj);
logical = efl_ui_focus_manager_focus_get(manager_top);