aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJihoon Kim <jihoon48.kim@samsung.com>2013-02-28 15:08:00 +0900
committerJihoon Kim <jihoon48.kim@samsung.com>2013-02-28 15:08:00 +0900
commit49930b7b899b080d5bc2ffdec2b8daf40eb916ac (patch)
treeed3b795b8beca9f099c45dcca3457dcf5034fe37
parent84d68de1e644c7f8136436a50a18a861e4581cbd (diff)
downloadefl-49930b7b899b080d5bc2ffdec2b8daf40eb916ac.tar.gz
efl-49930b7b899b080d5bc2ffdec2b8daf40eb916ac.tar.xz
efl-49930b7b899b080d5bc2ffdec2b8daf40eb916ac.zip
edje entry: set cursor position of selection start in selection mode
-rw-r--r--src/lib/edje/edje_entry.c22
1 files changed, 20 insertions, 2 deletions
diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c
index 80dfbc355..083b997dc 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;