summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2020-03-31 12:40:25 -0400
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2020-04-03 17:13:41 +0200
commit39b7069a0ba7dc2d3df2766c83a609ed8299cda5 (patch)
treeac4b6f1e4bdca90340dab490b16ec850762aa245
parent4ad9081c81eefacc5b79738561017042371b137f (diff)
efl_ui/layout: correctly batch object changed state when using freeze/thaw
previously this would always queue a recalc when calling thaw even if the object hadn't changed also mimic edje internal behavior with unsetting 'frozen' during force calc for possible future handling even though it has no effect presently Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D11628
-rw-r--r--src/lib/elementary/efl_ui_layout.c19
-rw-r--r--src/lib/elementary/efl_ui_layout_base.eo1
-rw-r--r--src/lib/elementary/elm_widget_layout.h1
3 files changed, 19 insertions, 2 deletions
diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c
index cc1f8e93a0..209665b1ad 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -1926,6 +1926,16 @@ _efl_ui_layout_base_efl_layout_group_part_exist_get(const Eo *obj, Efl_Ui_Layout
1926} 1926}
1927 1927
1928EOLIAN static void 1928EOLIAN static void
1929_efl_ui_layout_base_efl_canvas_group_group_change(Eo *obj, Efl_Ui_Layout_Data *sd)
1930{
1931 if (sd->frozen)
1932 /* cleared in thaw */
1933 sd->frozen_changed = EINA_TRUE;
1934 else
1935 efl_canvas_group_change(efl_super(obj, MY_CLASS));
1936}
1937
1938EOLIAN static void
1929_elm_layout_efl_canvas_group_change(Eo *obj, Elm_Layout_Data *ld) 1939_elm_layout_efl_canvas_group_change(Eo *obj, Elm_Layout_Data *ld)
1930{ 1940{
1931 Efl_Ui_Layout_Data *sd; 1941 Efl_Ui_Layout_Data *sd;
@@ -1991,7 +2001,9 @@ _efl_ui_layout_base_efl_layout_calc_calc_thaw(Eo *obj, Efl_Ui_Layout_Data *sd)
1991 if (!ret) 2001 if (!ret)
1992 { 2002 {
1993 sd->frozen = EINA_FALSE; 2003 sd->frozen = EINA_FALSE;
1994 efl_canvas_group_change(obj); 2004 if (sd->frozen_changed)
2005 efl_canvas_group_change(obj);
2006 sd->frozen_changed = EINA_FALSE;
1995 } 2007 }
1996 2008
1997 return ret; 2009 return ret;
@@ -2026,10 +2038,13 @@ _efl_ui_layout_base_efl_layout_calc_calc_parts_extends(Eo *obj EINA_UNUSED, Efl_
2026} 2038}
2027 2039
2028EOLIAN void 2040EOLIAN void
2029_efl_ui_layout_base_efl_layout_calc_calc_force(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Data *sd EINA_UNUSED) 2041_efl_ui_layout_base_efl_layout_calc_calc_force(Eo *obj EINA_UNUSED, Efl_Ui_Layout_Data *sd)
2030{ 2042{
2043 Eina_Bool prev_frozen = sd->frozen;
2031 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); 2044 ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd);
2045 sd->frozen = EINA_FALSE;
2032 efl_layout_calc_force(wd->resize_obj); 2046 efl_layout_calc_force(wd->resize_obj);
2047 sd->frozen = prev_frozen;
2033} 2048}
2034 2049
2035static Eina_Bool 2050static Eina_Bool
diff --git a/src/lib/elementary/efl_ui_layout_base.eo b/src/lib/elementary/efl_ui_layout_base.eo
index 8cd206c310..91b4f49049 100644
--- a/src/lib/elementary/efl_ui_layout_base.eo
+++ b/src/lib/elementary/efl_ui_layout_base.eo
@@ -110,6 +110,7 @@ abstract Efl.Ui.Layout_Base extends Efl.Ui.Widget implements Efl.Container,
110 Efl.Object.finalize; 110 Efl.Object.finalize;
111 Efl.Object.invalidate; 111 Efl.Object.invalidate;
112 Efl.Canvas.Group.group_calculate; 112 Efl.Canvas.Group.group_calculate;
113 Efl.Canvas.Group.group_change;
113 Efl.Layout.Calc.calc_freeze; 114 Efl.Layout.Calc.calc_freeze;
114 Efl.Layout.Calc.calc_thaw; 115 Efl.Layout.Calc.calc_thaw;
115 Efl.Layout.Calc.calc_auto_update_hints { get; set; } 116 Efl.Layout.Calc.calc_auto_update_hints { get; set; }
diff --git a/src/lib/elementary/elm_widget_layout.h b/src/lib/elementary/elm_widget_layout.h
index 69565b6fd9..a024656c7d 100644
--- a/src/lib/elementary/elm_widget_layout.h
+++ b/src/lib/elementary/elm_widget_layout.h
@@ -76,6 +76,7 @@ typedef struct _Efl_Ui_Layout_Data
76 Eina_Bool calc_subobjs : 1; /**< Set to true if group_calc should also handle subobjs during manual calc */ 76 Eina_Bool calc_subobjs : 1; /**< Set to true if group_calc should also handle subobjs during manual calc */
77 Eina_Bool cb_theme_changed : 1; /**< if theme,changed event subscriber has been added */ 77 Eina_Bool cb_theme_changed : 1; /**< if theme,changed event subscriber has been added */
78 Eina_Bool needs_theme_apply : 1; /**< if theme has not been manually set during construction */ 78 Eina_Bool needs_theme_apply : 1; /**< if theme has not been manually set during construction */
79 Eina_Bool frozen_changed : 1; /**< only set if object was changed while frozen */
79} Efl_Ui_Layout_Data; 80} Efl_Ui_Layout_Data;
80 81
81typedef struct _Elm_Layout_Data 82typedef struct _Elm_Layout_Data