aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-05-23 12:48:10 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-05-23 14:00:05 -0400
commit9b0748cd5f40c2206dae70c33d3bcae854dca26a (patch)
tree264cb980078e1c35183cef78784d5c1aad6c69c2
parentefl_ui_focus_manager_calc: add function to check if object is registered (diff)
downloadefl-devs/zmike/buildtest.tar.gz
efl_ui_widget: check for parent widget registration in focus before adding objectdevs/zmike/buildtest
in the case where a widget becomes visible without its parent being visible, adding the widget to a focus manager will fail. to avoid this, check for parent object being registered first. @fix
-rw-r--r--src/lib/elementary/efl_ui_widget.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c
index 70b8c828e5..a6f470413d 100644
--- a/src/lib/elementary/efl_ui_widget.c
+++ b/src/lib/elementary/efl_ui_widget.c
@@ -378,14 +378,20 @@ _efl_ui_widget_focus_state_apply(Eo *obj, Elm_Widget_Smart_Data *pd EINA_UNUSED,
registered = EINA_FALSE;
}
- //the parent may has changed
+ //the parent may have changed
if (current_state.parent != configured_state->parent && registered)
{
- return efl_ui_focus_manager_calc_update_parent(current_state.manager, obj, configured_state->parent);
+ /* the parent may not be visible, in which case it will not be registered. this is not an error. */
+ if (efl_ui_focus_manager_calc_registered_get(current_state.manager, configured_state->parent))
+ return efl_ui_focus_manager_calc_update_parent(current_state.manager, obj, configured_state->parent);
+ return EINA_FALSE;
}
if (!registered)
{
+ /* the parent may not be visible, in which case it will not be registered. this is not an error. */
+ if (!efl_ui_focus_manager_calc_registered_get(configured_state->manager, configured_state->parent))
+ return EINA_FALSE;
if (configured_state->logical)
return efl_ui_focus_manager_calc_register_logical(configured_state->manager, obj, configured_state->parent, redirect);
else