herdsman pushed a commit to branch master.

http://git.enlightenment.org/core/elementary.git/commit/?id=7d1c89c266cd196ab9f6f3886514a0cab64465bb

commit 7d1c89c266cd196ab9f6f3886514a0cab64465bb
Author: Daniel Hirt <daniel.h...@samsung.com>
Date:   Mon Aug 17 08:34:21 2015 +0300

    Entry: fix cursor repositioning on theme_apply
    
    Summary:
    The original code did not consider the case where the text will be
    reapplied by chunks. The repositioning of the cursor should be postponed
    to when the idler work is done, or not required at all.
    Fixes T2646.
    @fix
    
    Reviewers: NikaWhite
    
    Reviewed By: NikaWhite
    
    Maniphest Tasks: T2646
    
    Differential Revision: https://phab.enlightenment.org/D2952
---
 src/lib/elm_entry.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/src/lib/elm_entry.c b/src/lib/elm_entry.c
index c9e36d4..0ba453b 100644
--- a/src/lib/elm_entry.c
+++ b/src/lib/elm_entry.c
@@ -831,9 +831,6 @@ _elm_entry_elm_widget_theme_apply(Eo *obj, Elm_Entry_Data 
*sd)
    // and one of them can delete elm_entry.
    evas_object_ref(obj);
 
-   if (sd->cursor_pos != 0)
-     elm_entry_cursor_pos_set(obj, sd->cursor_pos);
-
    if (elm_widget_focus_get(obj))
      edje_object_signal_emit(sd->entry_edje, "elm,action,focus", "elm");
 
@@ -2689,6 +2686,8 @@ _text_append_idler(void *data)
      }
    else
      {
+        edje_object_part_text_cursor_pos_set(sd->entry_edje, "elm.text",
+              EDJE_CURSOR_MAIN, sd->cursor_pos);
         free(sd->append_text_left);
         sd->append_text_left = NULL;
         sd->append_text_idler = NULL;
@@ -2926,6 +2925,8 @@ _entry_text_append(Evas_Object* obj, const char* entry, 
Eina_Bool set)
                {
                   edje_object_part_text_append(sd->entry_edje, "elm.text", 
entry);
                }
+             edje_object_part_text_cursor_pos_set(sd->entry_edje, "elm.text",
+                   EDJE_CURSOR_MAIN, sd->cursor_pos);
              eo_do(obj, eo_event_callback_call(ELM_ENTRY_EVENT_TEXT_SET_DONE, 
NULL));
           }
      }

-- 


Reply via email to