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-Tag: submit/tizen/20180103.114435^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=c31c3e5ba504628f83cdd858cf3068d64f2dbb12;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 4d2f7f9e8..b3d9815b9 100644 --- a/src/lib/elm_entry.c +++ b/src/lib/elm_entry.c @@ -1819,9 +1819,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");