From: Youngbok Shin Date: Wed, 27 Dec 2017 10:28:31 +0000 (+0900) Subject: entry: fix cursor position initialization issues when theme is changed X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=baf41fd727d04373d645f9683cd3c366e4ca5e14;p=platform%2Fupstream%2Felementary.git entry: fix cursor position initialization issues when theme is changed The issue was caused by the following patch. "elm_entry: Save cursor position before entry text clear" It needed to get cursor position at the text_set function to avoid cursor position issue by delaying signal callback functions. So, we can't remove the patch. In the theme_apply, we need to handle cursor position more carefully to fix this side effect. @tizen_fix Change-Id: Id63aa401ba2572559bc241f54350b781c72f5092 --- diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c index e3c50f1df..7092f047b 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -1839,9 +1839,20 @@ _elm_entry_elm_widget_theme_apply(Eo *obj, Elm_Entry_Data *sd) edje_object_part_text_select_allow_set (sd->entry_edje, "elm.text", EINA_FALSE); + /* TIZEN_ONLY(20171227): fix cursor position initialization issues when theme is changed */ + int cursor_pos = sd->cursor_pos; + /* END */ elm_object_text_set(obj, t); eina_stringshare_del(t); + /* TIZEN_ONLY(20171227): fix cursor position initialization issues when theme is changed */ + if (sd->cursor_pos != cursor_pos) + { + sd->cursor_pos = cursor_pos; + edje_object_part_text_cursor_pos_set(sd->entry_edje, "elm.text", EDJE_CURSOR_MAIN, cursor_pos); + } + /* END */ + if (elm_widget_disabled_get(obj)) edje_object_signal_emit(sd->entry_edje, "elm,state,disabled", "elm");