Efl.Ui.Nstate: do not call "changed" callback
authorShinwoo Kim <cinoo.kim@samsung.com>
Wed, 7 Feb 2018 07:18:53 +0000 (16:18 +0900)
committerWonki Kim <wonki_.kim@samsung.com>
Thu, 5 Apr 2018 18:05:30 +0000 (03:05 +0900)
Before solving following problem in Efl.Ui.Check

https://phab.enlightenment.org/T6673

The changed callback is called with opposite value,
if application is using Efl.Ui.Check with state pointer.

The reason is that the changed callback is called in
efl_ui_nstate_activate, and the value refered by state pointer
is changed only after the efl_ui_nstate_activate is called.

static void
_activate(Evas_Object *obj)
{
   EFL_UI_CHECK_DATA_GET(obj, sd);

   efl_ui_nstate_activate(obj);
   if (sd->statep) *sd->statep = efl_ui_nstate_value_get(obj);

src/lib/elementary/efl_ui_nstate.c

index fbcbd53..f2f26e9 100644 (file)
@@ -107,12 +107,11 @@ _is_valid_state(Efl_Ui_Nstate_Data *sd, int state)
 }
 
 EOLIAN static void
-_efl_ui_nstate_value_set(Eo *obj, Efl_Ui_Nstate_Data *pd, int state)
+_efl_ui_nstate_value_set(Eo *obj EINA_UNUSED, Efl_Ui_Nstate_Data *pd, int state)
 {
    if (!_is_valid_state(pd, state)) return;
 
    pd->state = state;
-   _state_active(obj, pd);
 }
 
 EOLIAN static Efl_Ui_Theme_Apply
@@ -134,10 +133,9 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
 }
 
 EOLIAN static void
-_efl_ui_nstate_activate(Eo *obj, Efl_Ui_Nstate_Data *_pd)
+_efl_ui_nstate_activate(Eo *obj EINA_UNUSED, Efl_Ui_Nstate_Data *_pd)
 {
    _next_state_set(_pd);
-   _state_active(obj, _pd);
 }
 
 EOLIAN static void