aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWoochanlee <wc0917.lee@samsung.com>2019-04-12 15:45:37 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2019-04-12 15:45:37 +0900
commit638a36ea9a4d0bb9c77f1312cf556589a1250fc6 (patch)
tree23a7dc46b0bd39164dc4133107a31e38b9a92139
parentelementary: rename ELEMENTARY_BUILD to EFL_BUILD like all other libs (diff)
downloadefl-638a36ea9a4d0bb9c77f1312cf556589a1250fc6.tar.gz
efl_ui_widget: Fix disabled set calling without meaning.
Summary: The efl_ui_widget_disabled_set calling even the state is not change when widget create and destroy. It broken backward compatibility. https://phab.enlightenment.org/T7799 @fix Reviewers: bu5hm4n, Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8600
-rw-r--r--src/lib/elementary/efl_ui_widget.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/src/lib/elementary/efl_ui_widget.c b/src/lib/elementary/efl_ui_widget.c
index 15585ca731..c56990f8b3 100644
--- a/src/lib/elementary/efl_ui_widget.c
+++ b/src/lib/elementary/efl_ui_widget.c
@@ -1373,8 +1373,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;