From b4148b3e35e7146fe7246e525edcc28990ae41d8 Mon Sep 17 00:00:00 2001 From: Marcel Hollerbach Date: Fri, 15 Mar 2019 14:12:04 +0100 Subject: [PATCH] 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 Differential Revision: https://phab.enlightenment.org/D8367 Change-Id: I750d4ac6ebbb03f43a6727786316dd313021a87c --- src/lib/elementary/elm_gengrid.c | 9 ++++++--- src/lib/elementary/elm_widget_gengrid.h | 1 + src/lib/elementary/elm_widget_item_static_focus.c | 4 ---- 3 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib/elementary/elm_gengrid.c b/src/lib/elementary/elm_gengrid.c index abcf4cb..d3151c0 100644 --- a/src/lib/elementary/elm_gengrid.c +++ b/src/lib/elementary/elm_gengrid.c @@ -1370,6 +1370,7 @@ _elm_gengrid_item_unrealize(Elm_Gen_Item *it, { ELM_GENGRID_DATA_GET_FROM_ITEM(it, sd); efl_ui_focus_manager_calc_unregister(sd->obj, EO_OBJ(it)); + sd->order_dirty = EINA_TRUE; } evas_event_thaw(evas_object_evas_get(WIDGET(it))); @@ -1727,6 +1728,7 @@ _item_realize(Elm_Gen_Item *it) if (!it->realized) { efl_ui_focus_manager_calc_register_logical(sd->obj, EO_OBJ(it), sd->obj, NULL); + sd->order_dirty = EINA_TRUE; } if ((it->realized) || @@ -5372,9 +5374,7 @@ _elm_gengrid_item_new(Elm_Gengrid_Data *sd, sd->atspi_children = eina_list_append(sd->atspi_children, EO_OBJ(it)); // - efl_ui_focus_composition_dirty(sd->obj); - - return it; + return it; } EOLIAN static void @@ -7496,6 +7496,9 @@ _elm_gengrid_efl_ui_focus_object_setup_order(Eo *obj, Elm_Gengrid_Data *pd) if (elm_widget_is_legacy(obj)) return; // + if (!pd->order_dirty) return; + pd->order_dirty = EINA_FALSE; + EINA_INLIST_FOREACH(pd->items, item) { if (item->base->disabled) diff --git a/src/lib/elementary/elm_widget_gengrid.h b/src/lib/elementary/elm_widget_gengrid.h index e3e44ec..00dd04b 100644 --- a/src/lib/elementary/elm_widget_gengrid.h +++ b/src/lib/elementary/elm_widget_gengrid.h @@ -180,6 +180,7 @@ struct _Elm_Gengrid_Data Eina_Bool scr_minw; Eina_Bool scr_minh; + Eina_Bool order_dirty; /* boolean flag indicating if there needs to be an update to the focus_order of the widget.*/ }; struct 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 a18fac0..292045b 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) if (!elm_object_item_disabled_get(data) && !is_group) { - Elm_Widget_Item_Data *wpd = efl_data_scope_get(data, ELM_WIDGET_ITEM_CLASS); - - //first prepare the container - efl_ui_focus_object_setup_order(wpd->widget); efl_ui_focus_object_setup_order(data); } } -- 2.7.4