efl_ui_text: remove the event emits here
authorMarcel Hollerbach <marcel@osg.samsung.com>
Mon, 20 Nov 2017 21:38:08 +0000 (22:38 +0100)
committerMarcel Hollerbach <marcel@osg.samsung.com>
Tue, 21 Nov 2017 19:37:21 +0000 (20:37 +0100)
with the previous commit we emit the legacy events for each interface
event, and thus this event is not needed.

However, in elm_entry this means that changing editable will _not_
reemit the focus event (where i am not that sure if that is correct or
not).

src/lib/elementary/efl_ui_text.c
src/lib/elementary/elm_entry.c

index c1b9bd7..05619dc 100644 (file)
@@ -1211,7 +1211,6 @@ _efl_ui_text_elm_widget_on_focus_update(Eo *obj, Efl_Ui_Text_Data *sd, Elm_Objec
 
         if (top && top_is_win && sd->input_panel_enable && !sd->input_panel_show_on_demand)
           elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON);
-        efl_event_callback_legacy_call(obj, EFL_UI_WIDGET_EVENT_FOCUSED, NULL);
         if (_elm_config->atspi_mode)
           efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_FOCUSED, EINA_TRUE);
         _return_key_enabled_check(obj);
@@ -1228,7 +1227,6 @@ _efl_ui_text_elm_widget_on_focus_update(Eo *obj, Efl_Ui_Text_Data *sd, Elm_Objec
 
         if (top && top_is_win && sd->input_panel_enable)
           elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF);
-        efl_event_callback_legacy_call(obj, EFL_UI_WIDGET_EVENT_UNFOCUSED, NULL);
         if (_elm_config->atspi_mode)
           efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_FOCUSED, EINA_FALSE);
 
index 948fa05..6adff14 100644 (file)
@@ -1266,7 +1266,6 @@ _elm_entry_focus_update(Eo *obj, Elm_Entry_Data *sd)
         if (top && top_is_win && sd->input_panel_enable && !sd->input_panel_show_on_demand &&
             !edje_object_part_text_imf_context_get(sd->entry_edje, "elm.text"))
           elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_ON);
-        efl_event_callback_legacy_call(obj, EFL_UI_WIDGET_EVENT_FOCUSED, NULL);
         if (_elm_config->atspi_mode)
           efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_FOCUSED, EINA_TRUE);
         _return_key_enabled_check(obj);
@@ -1281,7 +1280,6 @@ _elm_entry_focus_update(Eo *obj, Elm_Entry_Data *sd)
         if (top && top_is_win && sd->input_panel_enable &&
             !edje_object_part_text_imf_context_get(sd->entry_edje, "elm.text"))
           elm_win_keyboard_mode_set(top, ELM_WIN_KEYBOARD_OFF);
-        efl_event_callback_legacy_call(obj, EFL_UI_WIDGET_EVENT_UNFOCUSED, NULL);
         if (_elm_config->atspi_mode)
           efl_access_state_changed_signal_emit(obj, EFL_ACCESS_STATE_FOCUSED, EINA_FALSE);
 
@@ -4255,6 +4253,12 @@ _elm_entry_editable_set(Eo *obj, Elm_Entry_Data *sd, Eina_Bool editable)
    efl_ui_widget_theme_apply(obj);
    _elm_entry_focus_update(obj, sd);
 
+   //legacy focus event emission
+   if (efl_ui_focus_object_focus_get(obj))
+     evas_object_smart_callback_call(obj, "focused", NULL);
+   else
+     evas_object_smart_callback_call(obj, "unfocused", NULL);
+
    elm_drop_target_del(obj, sd->drop_format,
                        _dnd_enter_cb, NULL,
                        _dnd_leave_cb, NULL,