summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorShinwoo Kim <cinoo.kim@samsung.com>2018-02-07 16:18:53 +0900
committerShinwoo Kim <cinoo.kim@samsung.com>2018-02-07 16:25:36 +0900
commitfd8e9f9c4e8dbda6c379dc464f562f5b2c681d31 (patch)
tree6eb75774071cc43216c912a06315665f863e1f77
parentd8aa950a388a2d207c598e5b6df459ac4f298bda (diff)
Efl.Ui.Nstate: do not call "changed" callback
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);
-rw-r--r--src/lib/elementary/efl_ui_check.c2
-rw-r--r--src/lib/elementary/efl_ui_nstate.c18
2 files changed, 4 insertions, 16 deletions
diff --git a/src/lib/elementary/efl_ui_check.c b/src/lib/elementary/efl_ui_check.c
index d36cdb0b1a..d119a8e6b9 100644
--- a/src/lib/elementary/efl_ui_check.c
+++ b/src/lib/elementary/efl_ui_check.c
@@ -75,6 +75,8 @@ _activate(Evas_Object *obj)
75 _elm_access_say(E_("State: Off")); 75 _elm_access_say(E_("State: Off"));
76 } 76 }
77 77
78 efl_event_callback_legacy_call(obj, EFL_UI_CHECK_EVENT_CHANGED, NULL);
79
78 if (_elm_config->atspi_mode) 80 if (_elm_config->atspi_mode)
79 efl_access_state_changed_signal_emit(obj, 81 efl_access_state_changed_signal_emit(obj,
80 EFL_ACCESS_STATE_CHECKED, 82 EFL_ACCESS_STATE_CHECKED,
diff --git a/src/lib/elementary/efl_ui_nstate.c b/src/lib/elementary/efl_ui_nstate.c
index c83ebfc8e4..5896826d09 100644
--- a/src/lib/elementary/efl_ui_nstate.c
+++ b/src/lib/elementary/efl_ui_nstate.c
@@ -63,18 +63,6 @@ _next_state_set(Efl_Ui_Nstate_Data *sd)
63 if (sd->state == sd->nstate) sd->state = 0; 63 if (sd->state == sd->nstate) sd->state = 0;
64} 64}
65 65
66static void
67_state_active(Evas_Object *obj, Efl_Ui_Nstate_Data *sd)
68{
69 char buf[64];
70
71 sprintf(buf, "elm,state,changed,%d", sd->state);
72 elm_layout_signal_emit(obj, buf, "elm");
73 edje_object_message_signal_process(elm_layout_edje_get(obj));
74 elm_layout_sizing_eval(obj);
75 efl_event_callback_legacy_call(obj, EFL_UI_NSTATE_EVENT_CHANGED, NULL);
76}
77
78EOLIAN static int 66EOLIAN static int
79_efl_ui_nstate_count_get(Eo *obj EINA_UNUSED, Efl_Ui_Nstate_Data *pd) 67_efl_ui_nstate_count_get(Eo *obj EINA_UNUSED, Efl_Ui_Nstate_Data *pd)
80{ 68{
@@ -106,12 +94,11 @@ _is_valid_state(Efl_Ui_Nstate_Data *sd, int state)
106} 94}
107 95
108EOLIAN static void 96EOLIAN static void
109_efl_ui_nstate_value_set(Eo *obj, Efl_Ui_Nstate_Data *pd, int state) 97_efl_ui_nstate_value_set(Eo *obj EINA_UNUSED, Efl_Ui_Nstate_Data *pd, int state)
110{ 98{
111 if (!_is_valid_state(pd, state)) return; 99 if (!_is_valid_state(pd, state)) return;
112 100
113 pd->state = state; 101 pd->state = state;
114 _state_active(obj, pd);
115} 102}
116 103
117EOLIAN static Efl_Ui_Theme_Apply 104EOLIAN static Efl_Ui_Theme_Apply
@@ -133,10 +120,9 @@ _key_action_activate(Evas_Object *obj, const char *params EINA_UNUSED)
133} 120}
134 121
135EOLIAN static void 122EOLIAN static void
136_efl_ui_nstate_activate(Eo *obj, Efl_Ui_Nstate_Data *_pd) 123_efl_ui_nstate_activate(Eo *obj EINA_UNUSED, Efl_Ui_Nstate_Data *_pd)
137{ 124{
138 _next_state_set(_pd); 125 _next_state_set(_pd);
139 _state_active(obj, _pd);
140} 126}
141 127
142EOLIAN static void 128EOLIAN static void