[Pkg-e-commits] [SCM] Enlightenment 17 branch, upstream-vcs, updated. 3eef8cab2cb6f039b529ffc89deb21a0dcab03df

andrunko andrunko at alioth.debian.org
Sat May 24 15:07:41 UTC 2008


The following commit has been merged in the upstream-vcs branch:
commit ab02704b1a59b3d2cae6b47aa9deb0745f6f448b
Author: andrunko <andrunko>
Date:   Thu May 15 21:08:30 2008 +0000

    Proper handle Ecore_IMF commit event.

diff --git a/src/bin/e_entry.c b/src/bin/e_entry.c
index d1dd80c..f19d068 100644
--- a/src/bin/e_entry.c
+++ b/src/bin/e_entry.c
@@ -1357,14 +1357,32 @@ _e_entry_cb_imf_event_commit(void *data, int type, void *event)
    Evas_Object *entry;
    E_Entry_Smart_Data *sd;
    Ecore_IMF_Event_Commit *ev = event;
+   Evas_Object *editable;
+   int cursor_pos, selection_pos;
+   int start_pos, end_pos;
+   int selecting;
+   int changed = 0;
 
    if ((!(entry = data)) || (!(sd = evas_object_smart_data_get(entry))))
      return 1;
 
    if (sd->imf_context != ev->ctx)
-      return 1;
+     return 1;
+
+   editable = sd->editable_object;
+   cursor_pos = e_editable_cursor_pos_get(editable);
+   selection_pos = e_editable_selection_pos_get(editable);
+   start_pos = (cursor_pos <= selection_pos) ? cursor_pos : selection_pos;
+   end_pos = (cursor_pos >= selection_pos) ? cursor_pos : selection_pos;
+   selecting = (start_pos != end_pos);
+
+   if (selecting)
+     changed |= e_editable_delete(editable, start_pos, end_pos);
+   changed |= e_editable_insert(editable, start_pos, ev->str);
+
+   if (changed)
+     evas_object_smart_callback_call(entry, "changed", NULL);
 
-   e_entry_text_set(entry, ev->str);
    return 0;
 }
 
@@ -1379,7 +1397,7 @@ _e_entry_cb_imf_event_delete_surrounding(void *data, int type, void *event)
    sd = data;
 
    if (sd->imf_context != ev->ctx)
-      return 1;
+     return 1;
 
    editable = sd->editable_object;
    cursor_pos = e_editable_cursor_pos_get(editable);

-- 
Enlightenment 17



More information about the Pkg-e-commits mailing list