From f9c54c4ca94f47f195f94815a2a48b3246479a7a Mon Sep 17 00:00:00 2001 From: Woochanlee Date: Fri, 12 Apr 2019 14:56:03 +0900 Subject: [PATCH] efl_ui_widget: Fix disabled set calling without meaning. The efl_ui_widget_disabled_set calling even the state is not change when widget create and destroy. It broken backward compatibility. T7799 @fix https://phab.enlightenment.org/D8600 Change-Id: Ib3be163cebf77e86f1aaa510e75454611d6911ce --- src/lib/elementary/efl_ui_widget.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c index b4dbf02..b0e3bab 100644 --- a/src/lib/elementary/efl_ui_widget.c +++ b/src/lib/elementary/efl_ui_widget.c @@ -1501,8 +1501,16 @@ _disabled_counter_get(Eo *widget) static void _mirror_disabled_state(Eo *obj, Elm_Widget_Smart_Data *pd, int disabled_delta) { + int prev_disabled = pd->disabled; + pd->disabled = (pd->parent_obj ? _disabled_counter_get(pd->parent_obj) : 0) + disabled_delta; + //The current disabled state is the same as the parent + //when the parent is assigned or changed, no further action is required. + if (((prev_disabled > 0 && pd->disabled > 0)) || + ((prev_disabled <= 0 && pd->disabled <= 0))) + return; + //we should not call disabled_set when things are invalidated //otherwise we will unleashe an amount of errors in efl_ui_layout if (efl_invalidated_get(obj)) return; -- 2.7.4