summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-03-15 13:37:33 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-03-25 10:54:12 +0100
commitf1678d06c29165118bd82ecdf8dc273f4df9c60b (patch)
treeb7df2620871a135b362a1a66c3346f9725a8cc08
parent834219013d9e7aa403ed2d7385c427e1ae12a22c (diff)
elm_gengrid: rework focus registration
before just everything has been registered, now only the realized items are registered. ref T7384 Reviewed-by: Cedric BAIL <cedric.bail@free.fr> Differential Revision: https://phab.enlightenment.org/D8366
-rw-r--r--src/lib/elementary/elm_gengrid.c18
-rw-r--r--src/lib/elementary/elm_gengrid_eo.c6
2 files changed, 17 insertions, 7 deletions
diff --git a/src/lib/elementary/elm_gengrid.c b/src/lib/elementary/elm_gengrid.c
index 8bdc99a25d..8f253d1b22 100644
--- a/src/lib/elementary/elm_gengrid.c
+++ b/src/lib/elementary/elm_gengrid.c
@@ -1265,6 +1265,11 @@ _elm_gengrid_item_unrealize(Elm_Gen_Item *it,
1265 it->realized = EINA_FALSE; 1265 it->realized = EINA_FALSE;
1266 it->want_unrealize = EINA_FALSE; 1266 it->want_unrealize = EINA_FALSE;
1267 1267
1268 {
1269 ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd);
1270 efl_ui_focus_manager_calc_unregister(sd->obj, EO_OBJ(it));
1271 }
1272
1268 evas_event_thaw(evas_object_evas_get(WIDGET(it))); 1273 evas_event_thaw(evas_object_evas_get(WIDGET(it)));
1269 evas_event_thaw_eval(evas_object_evas_get(WIDGET(it))); 1274 evas_event_thaw_eval(evas_object_evas_get(WIDGET(it)));
1270} 1275}
@@ -1593,6 +1598,11 @@ _item_realize(Elm_Gen_Item *it)
1593 ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd); 1598 ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd);
1594 Elm_Object_Item *eo_it = EO_OBJ(it); 1599 Elm_Object_Item *eo_it = EO_OBJ(it);
1595 1600
1601 if (!it->realized)
1602 {
1603 efl_ui_focus_manager_calc_register_logical(sd->obj, EO_OBJ(it), sd->obj, NULL);
1604 }
1605
1596 if ((it->realized) || 1606 if ((it->realized) ||
1597 (it->generation < sd->generation)) 1607 (it->generation < sd->generation))
1598 return; 1608 return;
@@ -4359,8 +4369,6 @@ _elm_gengrid_efl_object_constructor(Eo *obj, Elm_Gengrid_Data *sd)
4359 efl_ui_focus_parent_provider_gen_container_set(efl_added, obj), 4369 efl_ui_focus_parent_provider_gen_container_set(efl_added, obj),
4360 efl_ui_focus_parent_provider_gen_content_item_map_set(efl_added, sd->content_item_map)); 4370 efl_ui_focus_parent_provider_gen_content_item_map_set(efl_added, sd->content_item_map));
4361 4371
4362 efl_ui_focus_composition_logical_mode_set(obj, EINA_TRUE);
4363
4364 obj = efl_constructor(efl_super(obj, MY_CLASS)); 4372 obj = efl_constructor(efl_super(obj, MY_CLASS));
4365 sd->obj = obj; 4373 sd->obj = obj;
4366 4374
@@ -5811,7 +5819,7 @@ _elm_gengrid_efl_object_provider_find(const Eo *obj, Elm_Gengrid_Data *pd, const
5811} 5819}
5812 5820
5813EOLIAN static void 5821EOLIAN static void
5814_elm_gengrid_efl_ui_focus_composition_prepare(Eo *obj, Elm_Gengrid_Data *pd) 5822_elm_gengrid_efl_ui_focus_object_setup_order(Eo *obj, Elm_Gengrid_Data *pd)
5815{ 5823{
5816 Elm_Gen_Item *item; 5824 Elm_Gen_Item *item;
5817 Eina_List *order = NULL; 5825 Eina_List *order = NULL;
@@ -5822,11 +5830,13 @@ _elm_gengrid_efl_ui_focus_composition_prepare(Eo *obj, Elm_Gengrid_Data *pd)
5822 continue; 5830 continue;
5823 if (item->group) 5831 if (item->group)
5824 continue; 5832 continue;
5833 if (item->realized)
5834 continue;
5825 5835
5826 order = eina_list_append(order, item->base->eo_obj); 5836 order = eina_list_append(order, item->base->eo_obj);
5827 } 5837 }
5828 5838
5829 efl_ui_focus_composition_elements_set(obj, order); 5839 efl_ui_focus_manager_calc_update_order(obj, obj, order);
5830} 5840}
5831 5841
5832EOLIAN static Eina_Bool 5842EOLIAN static Eina_Bool
diff --git a/src/lib/elementary/elm_gengrid_eo.c b/src/lib/elementary/elm_gengrid_eo.c
index e87ad58aef..89263f9c1f 100644
--- a/src/lib/elementary/elm_gengrid_eo.c
+++ b/src/lib/elementary/elm_gengrid_eo.c
@@ -386,7 +386,7 @@ Eina_Bool _elm_gengrid_efl_access_selection_all_children_select(Eo *obj, Elm_Gen
386Eina_Bool _elm_gengrid_efl_access_selection_access_selection_clear(Eo *obj, Elm_Gengrid_Data *pd); 386Eina_Bool _elm_gengrid_efl_access_selection_access_selection_clear(Eo *obj, Elm_Gengrid_Data *pd);
387 387
388 388
389void _elm_gengrid_efl_ui_focus_composition_prepare(Eo *obj, Elm_Gengrid_Data *pd); 389void _elm_gengrid_efl_ui_focus_object_setup_order(Eo *obj, Elm_Gengrid_Data *pd);
390 390
391 391
392Eina_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); 392Eina_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);
@@ -478,7 +478,7 @@ _elm_gengrid_class_initializer(Efl_Class *klass)
478 EFL_OBJECT_OP_FUNC(efl_access_selection_is_child_selected, _elm_gengrid_efl_access_selection_is_child_selected), 478 EFL_OBJECT_OP_FUNC(efl_access_selection_is_child_selected, _elm_gengrid_efl_access_selection_is_child_selected),
479 EFL_OBJECT_OP_FUNC(efl_access_selection_all_children_select, _elm_gengrid_efl_access_selection_all_children_select), 479 EFL_OBJECT_OP_FUNC(efl_access_selection_all_children_select, _elm_gengrid_efl_access_selection_all_children_select),
480 EFL_OBJECT_OP_FUNC(efl_access_selection_clear, _elm_gengrid_efl_access_selection_access_selection_clear), 480 EFL_OBJECT_OP_FUNC(efl_access_selection_clear, _elm_gengrid_efl_access_selection_access_selection_clear),
481 EFL_OBJECT_OP_FUNC(efl_ui_focus_composition_prepare, _elm_gengrid_efl_ui_focus_composition_prepare), 481 EFL_OBJECT_OP_FUNC(efl_ui_focus_object_setup_order, _elm_gengrid_efl_ui_focus_object_setup_order),
482 EFL_OBJECT_OP_FUNC(efl_ui_widget_focus_state_apply, _elm_gengrid_efl_ui_widget_focus_state_apply), 482 EFL_OBJECT_OP_FUNC(efl_ui_widget_focus_state_apply, _elm_gengrid_efl_ui_widget_focus_state_apply),
483 EFL_OBJECT_OP_FUNC(efl_ui_focus_manager_setup_on_first_touch, _elm_gengrid_efl_ui_focus_manager_setup_on_first_touch), 483 EFL_OBJECT_OP_FUNC(efl_ui_focus_manager_setup_on_first_touch, _elm_gengrid_efl_ui_focus_manager_setup_on_first_touch),
484 EFL_OBJECT_OP_FUNC(efl_ui_focus_manager_focus_get, _elm_gengrid_efl_ui_focus_manager_manager_focus_get), 484 EFL_OBJECT_OP_FUNC(efl_ui_focus_manager_focus_get, _elm_gengrid_efl_ui_focus_manager_manager_focus_get),
@@ -512,6 +512,6 @@ static const Efl_Class_Description _elm_gengrid_class_desc = {
512 NULL 512 NULL
513}; 513};
514 514
515EFL_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); 515EFL_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);
516 516
517#include "elm_gengrid_eo.legacy.c" 517#include "elm_gengrid_eo.legacy.c"