summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2018-07-19 17:01:05 +0900
committerHermet Park <hermetpark@gmail.com>2018-07-19 17:01:05 +0900
commit5e64ddec31aeda742ef5a8757b85a64dac0e4eb8 (patch)
treee8b3d6a1ac8340a6628b0541cee192624eb361e7
parentb00f0e06305d9839c9bfbbdf413e6318ebf06d18 (diff)
elm/list: block recursive recalc loops
Summary: this size hints callback is triggered by both list objects and list item objects, meaning that setting size hints on the item objects during recalc will trigger a recursive recalc, potentially infinitely this blocks recursive recalcs unless triggered by size hint changes from a main list object, since those will eventually resolve themselves fix T7121 Reviewers: devilhorns, Hermet Reviewed By: Hermet Subscribers: netstar, DaveMDS, cedric, #committers Tags: #efl_widgets Maniphest Tasks: T7121 Differential Revision: https://phab.enlightenment.org/D6572
-rw-r--r--src/lib/elementary/elm_list.c9
-rw-r--r--src/lib/elementary/elm_widget_list.h1
2 files changed, 9 insertions, 1 deletions
diff --git a/src/lib/elementary/elm_list.c b/src/lib/elementary/elm_list.c
index 17464df64e..227315df99 100644
--- a/src/lib/elementary/elm_list.c
+++ b/src/lib/elementary/elm_list.c
@@ -851,6 +851,7 @@ _items_fix(Evas_Object *obj)
851 } 851 }
852 852
853 _elm_list_walk(obj, sd); // watch out "return" before unwalk! 853 _elm_list_walk(obj, sd); // watch out "return" before unwalk!
854 sd->fixing_now = EINA_TRUE;
854 855
855 eina_array_step_set(&walk, sizeof (walk), 8); 856 eina_array_step_set(&walk, sizeof (walk), 8);
856 857
@@ -1036,6 +1037,7 @@ _items_fix(Evas_Object *obj)
1036 efl_unref(eo_it); 1037 efl_unref(eo_it);
1037 } 1038 }
1038 1039
1040 sd->fixing_now = EINA_FALSE;
1039 _elm_list_unwalk(obj, sd); 1041 _elm_list_unwalk(obj, sd);
1040 1042
1041 //focus highlight in_theme is set by list item theme. 1043 //focus highlight in_theme is set by list item theme.
@@ -1046,12 +1048,17 @@ _items_fix(Evas_Object *obj)
1046static void 1048static void
1047_size_hints_changed_cb(void *data, 1049_size_hints_changed_cb(void *data,
1048 Evas *e EINA_UNUSED, 1050 Evas *e EINA_UNUSED,
1049 Evas_Object *obj EINA_UNUSED, 1051 Evas_Object *obj,
1050 void *event_info EINA_UNUSED) 1052 void *event_info EINA_UNUSED)
1051{ 1053{
1052 ELM_LIST_DATA_GET(data, sd); 1054 ELM_LIST_DATA_GET(data, sd);
1055 ELM_WIDGET_DATA_GET_OR_RETURN(data, wd);
1053 if (sd->delete_me) return; 1056 if (sd->delete_me) return;
1054 1057
1058 if (sd->fixing_now)
1059 {
1060 if ((obj != wd->resize_obj) && (obj != sd->box)) return;
1061 }
1055 _items_fix(data); 1062 _items_fix(data);
1056 elm_layout_sizing_eval(data); 1063 elm_layout_sizing_eval(data);
1057} 1064}
diff --git a/src/lib/elementary/elm_widget_list.h b/src/lib/elementary/elm_widget_list.h
index cc642a29e0..707f170e92 100644
--- a/src/lib/elementary/elm_widget_list.h
+++ b/src/lib/elementary/elm_widget_list.h
@@ -64,6 +64,7 @@ struct _Elm_List_Data
64 Eina_Bool mouse_down : 1; /**< a flag that mouse is down on the list at the moment. this flag is set to true on mouse and reset to false on mouse up */ 64 Eina_Bool mouse_down : 1; /**< a flag that mouse is down on the list at the moment. this flag is set to true on mouse and reset to false on mouse up */
65 Eina_Bool item_loop_enable : 1; /**< value whether item loop feature is enabled or not. */ 65 Eina_Bool item_loop_enable : 1; /**< value whether item loop feature is enabled or not. */
66 Eina_Bool item_looping_on : 1; 66 Eina_Bool item_looping_on : 1;
67 Eina_Bool fixing_now : 1;
67}; 68};
68 69
69struct _Elm_List_Item_Data 70struct _Elm_List_Item_Data