From: Jihoon Kim Date: Thu, 28 Feb 2013 06:08:00 +0000 (+0900) Subject: edje entry: set cursor position of selection start in selection mode X-Git-Tag: submit/devel/efl/20131022.203902~1719 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=49930b7b899b080d5bc2ffdec2b8daf40eb916ac;p=platform%2Fupstream%2Fefl.git edje entry: set cursor position of selection start in selection mode --- diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c index 80dfbc3..083b997 100644 --- a/src/lib/edje/edje_entry.c +++ b/src/lib/edje/edje_entry.c @@ -494,6 +494,9 @@ _sel_extend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) _sel_enable(c, o, en); if (!evas_textblock_cursor_compare(c, en->sel_end)) return; evas_textblock_cursor_copy(c, en->sel_end); + + _edje_entry_imf_cursor_info_set(en); + if (en->selection) { free(en->selection); @@ -510,6 +513,9 @@ _sel_preextend(Evas_Textblock_Cursor *c, Evas_Object *o, Entry *en) _sel_enable(c, o, en); if (!evas_textblock_cursor_compare(c, en->sel_start)) return; evas_textblock_cursor_copy(c, en->sel_start); + + _edje_entry_imf_cursor_info_set(en); + if (en->selection) { free(en->selection); @@ -3614,11 +3620,23 @@ _edje_entry_imf_cursor_location_set(Entry *en) static void _edje_entry_imf_cursor_info_set(Entry *en) { + int cursor_pos; + #ifdef HAVE_ECORE_IMF if (!en || !en->rp || !en->imf_context) return; - ecore_imf_context_cursor_position_set(en->imf_context, - evas_textblock_cursor_pos_get(en->cursor)); + if (en->have_selection) + { + if (evas_textblock_cursor_compare(en->sel_start, en->sel_end) < 0) + cursor_pos = evas_textblock_cursor_pos_get(en->sel_start); + else + cursor_pos = evas_textblock_cursor_pos_get(en->sel_end); + } + else + cursor_pos = evas_textblock_cursor_pos_get(en->cursor); + + ecore_imf_context_cursor_position_set(en->imf_context, cursor_pos); + _edje_entry_imf_cursor_location_set(en); #else (void) en;