summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarcel Hollerbach <mail@marcel-hollerbach.de>2019-03-15 14:12:04 +0100
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-03-25 10:54:13 +0100
commit04122ec311406c689124b69fe60cf1d0f316db88 (patch)
treeda9da88eb8110a2b01a349fbc721982ace03d6ed
parentf1678d06c29165118bd82ecdf8dc273f4df9c60b (diff)
elm_gengrid: speed up update order calls
update order can be quite expensive, so this here tries to skip it as often as possible. ref T7384 Reviewed-by: SangHyeon Jade Lee <sh10233.lee@samsung.com> Differential Revision: https://phab.enlightenment.org/D8367
-rw-r--r--src/lib/elementary/elm_gengrid.c9
-rw-r--r--src/lib/elementary/elm_widget_gengrid.h1
-rw-r--r--src/lib/elementary/elm_widget_item_static_focus.c4
3 files changed, 7 insertions, 7 deletions
diff --git a/src/lib/elementary/elm_gengrid.c b/src/lib/elementary/elm_gengrid.c
index 8f253d1b22..7617df3b07 100644
--- a/src/lib/elementary/elm_gengrid.c
+++ b/src/lib/elementary/elm_gengrid.c
@@ -1268,6 +1268,7 @@ _elm_gengrid_item_unrealize(Elm_Gen_Item *it,
1268 { 1268 {
1269 ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd); 1269 ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd);
1270 efl_ui_focus_manager_calc_unregister(sd->obj, EO_OBJ(it)); 1270 efl_ui_focus_manager_calc_unregister(sd->obj, EO_OBJ(it));
1271 sd->order_dirty = EINA_TRUE;
1271 } 1272 }
1272 1273
1273 evas_event_thaw(evas_object_evas_get(WIDGET(it))); 1274 evas_event_thaw(evas_object_evas_get(WIDGET(it)));
@@ -1601,6 +1602,7 @@ _item_realize(Elm_Gen_Item *it)
1601 if (!it->realized) 1602 if (!it->realized)
1602 { 1603 {
1603 efl_ui_focus_manager_calc_register_logical(sd->obj, EO_OBJ(it), sd->obj, NULL); 1604 efl_ui_focus_manager_calc_register_logical(sd->obj, EO_OBJ(it), sd->obj, NULL);
1605 sd->order_dirty = EINA_TRUE;
1604 } 1606 }
1605 1607
1606 if ((it->realized) || 1608 if ((it->realized) ||
@@ -4037,9 +4039,7 @@ _elm_gengrid_item_new(Elm_Gengrid_Data *sd,
4037 (!strcmp(it->itc->item_style, "group_index")); 4039 (!strcmp(it->itc->item_style, "group_index"));
4038 sd->item_count++; 4040 sd->item_count++;
4039 4041
4040 efl_ui_focus_composition_dirty(sd->obj); 4042 return it;
4041
4042 return it;
4043} 4043}
4044 4044
4045EOLIAN static void 4045EOLIAN static void
@@ -5824,6 +5824,9 @@ _elm_gengrid_efl_ui_focus_object_setup_order(Eo *obj, Elm_Gengrid_Data *pd)
5824 Elm_Gen_Item *item; 5824 Elm_Gen_Item *item;
5825 Eina_List *order = NULL; 5825 Eina_List *order = NULL;
5826 5826
5827 if (!pd->order_dirty) return;
5828 pd->order_dirty = EINA_FALSE;
5829
5827 EINA_INLIST_FOREACH(pd->items, item) 5830 EINA_INLIST_FOREACH(pd->items, item)
5828 { 5831 {
5829 if (item->base->disabled) 5832 if (item->base->disabled)
diff --git a/src/lib/elementary/elm_widget_gengrid.h b/src/lib/elementary/elm_widget_gengrid.h
index f17b75e8ab..dc93910041 100644
--- a/src/lib/elementary/elm_widget_gengrid.h
+++ b/src/lib/elementary/elm_widget_gengrid.h
@@ -154,6 +154,7 @@ struct _Elm_Gengrid_Data
154 154
155 Eina_Bool scr_minw; 155 Eina_Bool scr_minw;
156 Eina_Bool scr_minh; 156 Eina_Bool scr_minh;
157 Eina_Bool order_dirty; /* boolean flag indicating if there needs to be an update to the focus_order of the widget.*/
157}; 158};
158 159
159struct Elm_Gen_Item_Type 160struct Elm_Gen_Item_Type
diff --git a/src/lib/elementary/elm_widget_item_static_focus.c b/src/lib/elementary/elm_widget_item_static_focus.c
index a94e80fb19..c2061ed808 100644
--- a/src/lib/elementary/elm_widget_item_static_focus.c
+++ b/src/lib/elementary/elm_widget_item_static_focus.c
@@ -54,10 +54,6 @@ _grid_realized_cb(void *data, const Efl_Event *ev)
54 54
55 if (!elm_object_item_disabled_get(data) && !is_group) 55 if (!elm_object_item_disabled_get(data) && !is_group)
56 { 56 {
57 Elm_Widget_Item_Data *wpd = efl_data_scope_get(data, ELM_WIDGET_ITEM_CLASS);
58
59 //first prepare the container
60 efl_ui_focus_object_setup_order(wpd->widget);
61 efl_ui_focus_object_setup_order(data); 57 efl_ui_focus_object_setup_order(data);
62 } 58 }
63} 59}