From: Marcel Hollerbach Date: Fri, 15 Mar 2019 12:37:33 +0000 (+0100) Subject: elm_gengrid: rework focus registration X-Git-Tag: submit/tizen/20190402.051338~93 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=a2124b1c8a0211935bb5bb9bb62c537f6fb34aec;p=platform%2Fupstream%2Fefl.git elm_gengrid: rework focus registration before just everything has been registered, now only the realized items are registered. ref T7384 Reviewed-by: Cedric BAIL Differential Revision: https://phab.enlightenment.org/D8366 Change-Id: I15fe4b231ba5660c4edffceaadd199d7c31ba96f --- diff --git a/src/lib/elementary/elm_gengrid.c b/src/lib/elementary/elm_gengrid.c index 7b2a0f0..abcf4cb 100644 --- a/src/lib/elementary/elm_gengrid.c +++ b/src/lib/elementary/elm_gengrid.c @@ -1367,6 +1367,11 @@ _elm_gengrid_item_unrealize(Elm_Gen_Item *it, it->realized = EINA_FALSE; it->want_unrealize = EINA_FALSE; + { + ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd); + efl_ui_focus_manager_calc_unregister(sd->obj, EO_OBJ(it)); + } + evas_event_thaw(evas_object_evas_get(WIDGET(it))); evas_event_thaw_eval(evas_object_evas_get(WIDGET(it))); @@ -1719,6 +1724,11 @@ _item_realize(Elm_Gen_Item *it) ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd); Elm_Object_Item *eo_it = EO_OBJ(it); + if (!it->realized) + { + efl_ui_focus_manager_calc_register_logical(sd->obj, EO_OBJ(it), sd->obj, NULL); + } + if ((it->realized) || (it->generation < sd->generation)) return; @@ -5765,8 +5775,6 @@ _elm_gengrid_efl_object_constructor(Eo *obj, Elm_Gengrid_Data *sd) efl_ui_focus_parent_provider_gen_container_set(efl_added, obj), efl_ui_focus_parent_provider_gen_content_item_map_set(efl_added, sd->content_item_map)); - efl_ui_focus_composition_logical_mode_set(obj, EINA_TRUE); - efl_event_callback_add(obj, EFL_UI_FOCUS_MANAGER_EVENT_MANAGER_FOCUS_CHANGED, _gengrid_element_focused, obj); } @@ -7479,7 +7487,7 @@ _elm_gengrid_efl_object_provider_find(const Eo *obj, Elm_Gengrid_Data *pd, const } EOLIAN static void -_elm_gengrid_efl_ui_focus_composition_prepare(Eo *obj, Elm_Gengrid_Data *pd) +_elm_gengrid_efl_ui_focus_object_setup_order(Eo *obj, Elm_Gengrid_Data *pd) { Elm_Gen_Item *item; Eina_List *order = NULL; @@ -7494,11 +7502,13 @@ _elm_gengrid_efl_ui_focus_composition_prepare(Eo *obj, Elm_Gengrid_Data *pd) continue; if (item->group) continue; + if (item->realized) + continue; order = eina_list_append(order, item->base->eo_obj); } - efl_ui_focus_composition_elements_set(obj, order); + efl_ui_focus_manager_calc_update_order(obj, obj, order); } EOLIAN static Eina_Bool diff --git a/src/lib/elementary/elm_gengrid_eo.c b/src/lib/elementary/elm_gengrid_eo.c index 8db451d..177399b 100644 --- a/src/lib/elementary/elm_gengrid_eo.c +++ b/src/lib/elementary/elm_gengrid_eo.c @@ -389,7 +389,7 @@ Eina_Bool _elm_gengrid_efl_access_selection_all_children_select(Eo *obj, Elm_Gen Eina_Bool _elm_gengrid_efl_access_selection_access_selection_clear(Eo *obj, Elm_Gengrid_Data *pd); -void _elm_gengrid_efl_ui_focus_composition_prepare(Eo *obj, Elm_Gengrid_Data *pd); +void _elm_gengrid_efl_ui_focus_object_setup_order(Eo *obj, Elm_Gengrid_Data *pd); Eina_Bool _elm_gengrid_efl_ui_widget_focus_state_apply(Eo *obj, Elm_Gengrid_Data *pd, Efl_Ui_Widget_Focus_State current_state, Efl_Ui_Widget_Focus_State *configured_state, Efl_Ui_Widget *redirect); @@ -506,7 +506,7 @@ _elm_gengrid_class_initializer(Efl_Class *klass) EFL_OBJECT_OP_FUNC(efl_access_selection_is_child_selected, _elm_gengrid_efl_access_selection_is_child_selected), EFL_OBJECT_OP_FUNC(efl_access_selection_all_children_select, _elm_gengrid_efl_access_selection_all_children_select), EFL_OBJECT_OP_FUNC(efl_access_selection_clear, _elm_gengrid_efl_access_selection_access_selection_clear), - EFL_OBJECT_OP_FUNC(efl_ui_focus_composition_prepare, _elm_gengrid_efl_ui_focus_composition_prepare), + EFL_OBJECT_OP_FUNC(efl_ui_focus_object_setup_order, _elm_gengrid_efl_ui_focus_object_setup_order), EFL_OBJECT_OP_FUNC(efl_ui_widget_focus_state_apply, _elm_gengrid_efl_ui_widget_focus_state_apply), EFL_OBJECT_OP_FUNC(efl_ui_focus_manager_setup_on_first_touch, _elm_gengrid_efl_ui_focus_manager_setup_on_first_touch), EFL_OBJECT_OP_FUNC(efl_ui_focus_manager_focus_get, _elm_gengrid_efl_ui_focus_manager_manager_focus_get), @@ -548,6 +548,6 @@ static const Efl_Class_Description _elm_gengrid_class_desc = { NULL }; -EFL_DEFINE_CLASS(elm_gengrid_class_get, &_elm_gengrid_class_desc, EFL_UI_LAYOUT_BASE_CLASS, EFL_UI_FOCUS_COMPOSITION_MIXIN, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); +EFL_DEFINE_CLASS(elm_gengrid_class_get, &_elm_gengrid_class_desc, EFL_UI_LAYOUT_BASE_CLASS, ELM_INTERFACE_SCROLLABLE_MIXIN, EFL_UI_CLICKABLE_INTERFACE, EFL_ACCESS_WIDGET_ACTION_MIXIN, EFL_ACCESS_SELECTION_INTERFACE, EFL_UI_LEGACY_INTERFACE, ELM_WIDGET_ITEM_CONTAINER_INTERFACE, NULL); #include "elm_gengrid_eo.legacy.c"