forked from enlightenment/efl
elementary: Check for valid focus manager before starting do loop
Summary: Apparently there are cases where efl_ui_focus_object_focus_manager_get can return NULL. In order to trap for this, we can simply modify the do loop slightly and check for a valid manager before we actually start looping Test Case: elementary_test -to "Panel Scrollable" and click Toggle button ref T7030 Depends on D6703 Reviewers: bu5hm4n, YOhoho Subscribers: #reviewers, cedric, #committers, zmike Tags: #efl_widgets_focus Maniphest Tasks: T7030 Differential Revision: https://phab.enlightenment.org/D6704
This commit is contained in:
parent
69894bc476
commit
364ca1d2b2
|
@ -31,6 +31,14 @@ _efl_ui_focus_util_focus(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Ui_Focus
|
|||
registered_manager = m = efl_ui_focus_object_focus_manager_get(user);
|
||||
entry = user;
|
||||
|
||||
if (!m)
|
||||
{
|
||||
//delayed focusung
|
||||
efl_key_data_set(top, "__delayed_focus_set", entry);
|
||||
efl_event_callback_add(entry, EFL_UI_FOCUS_OBJECT_EVENT_MANAGER_CHANGED, _manager_changed, user);
|
||||
return;
|
||||
}
|
||||
|
||||
do {
|
||||
//check if the root of a manager is the window root, set focus to this object in the manager than
|
||||
entry = efl_ui_focus_manager_root_get(m);
|
||||
|
@ -43,13 +51,6 @@ _efl_ui_focus_util_focus(Eo *obj EINA_UNUSED, void *pd EINA_UNUSED, Efl_Ui_Focus
|
|||
|
||||
//if there is no manager yet, delay the focus setting until this entity gets registered for one chain
|
||||
m = efl_ui_focus_object_focus_manager_get(entry);
|
||||
if (!m)
|
||||
{
|
||||
//delayed focusung
|
||||
efl_key_data_set(top, "__delayed_focus_set", entry);
|
||||
efl_event_callback_add(entry, EFL_UI_FOCUS_OBJECT_EVENT_MANAGER_CHANGED, _manager_changed, user);
|
||||
return;
|
||||
}
|
||||
} while (m);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue