Imported Upstream version 1.7.4
[platform/upstream/edje.git] / src / lib / edje_entry.c
index 3307e34..31fc569 100644 (file)
@@ -1738,7 +1738,7 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
    Evas_Textblock_Cursor *tc = NULL;
    Eina_Bool dosel = EINA_FALSE;
    Eina_Bool shift;
-   if (!rp) return;
+   if ((!rp) || (!ev)) return;
    if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
    en = rp->entry_data;
    if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
@@ -1758,6 +1758,8 @@ _edje_part_mouse_down_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
      }
 #endif
 
+   _edje_entry_imf_context_reset(rp);
+
    shift = evas_key_modifier_is_set(ev->modifiers, "Shift");
    en->select_mod_start = EINA_FALSE;
    en->select_mod_end = EINA_FALSE;
@@ -1966,7 +1968,7 @@ _edje_part_mouse_up_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUSED
    Entry *en;
    Evas_Coord x, y, w, h;
    Evas_Textblock_Cursor *tc;
-   if (ev->button != 1) return;
+   if ((!ev) || (ev->button != 1)) return;
    if (!rp) return;
    if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
    if (ev->flags & EVAS_BUTTON_TRIPLE_CLICK) return;
@@ -2075,7 +2077,7 @@ _edje_part_mouse_move_cb(void *data, Evas *e __UNUSED__, Evas_Object *obj __UNUS
    Entry *en;
    Evas_Coord x, y, w, h;
    Evas_Textblock_Cursor *tc;
-   if (!rp) return;
+   if (!rp || (!ev)) return;
    en = rp->entry_data;
    if ((!en) || (rp->part->type != EDJE_PART_TYPE_TEXTBLOCK) ||
        (rp->part->entry_mode < EDJE_ENTRY_EDIT_MODE_SELECTABLE))
@@ -2169,6 +2171,7 @@ static void
 _evas_focus_in_cb(void *data, Evas *e, __UNUSED__ void *event_info)
 {
    Edje *ed = (Edje *)data;
+   if (!ed) return;
 
    if (evas_focus_get(e) == ed->obj)
      {
@@ -2180,6 +2183,7 @@ static void
 _evas_focus_out_cb(void *data, Evas *e, __UNUSED__ void *event_info)
 {
    Edje *ed = (Edje *)data;
+   if (!ed) return;
 
    if (evas_focus_get(e) == ed->obj)
      {
@@ -2208,7 +2212,7 @@ _edje_entry_init(Edje *ed)
 void
 _edje_entry_shutdown(Edje *ed)
 {
-   if (!ed->has_entries)
+   if ((!ed) || (!ed->has_entries))
      return;
    if (!ed->entries_inited)
      return;
@@ -2721,6 +2725,9 @@ _edje_entry_user_insert(Edje_Real_Part *rp, const char *text)
    _edje_emit_full(rp->edje, "entry,changed,user", rp->part->name,
                    info, _free_entry_change_info);
    _edje_emit(rp->edje, "cursor,changed", rp->part->name);
+
+   _edje_entry_imf_cursor_info_set(en);
+   _edje_entry_real_part_configure(rp);
 }
 
 void
@@ -3429,6 +3436,9 @@ _edje_entry_imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx __UNUSED__, v
                         info, _free_entry_change_info);
         _edje_emit(ed, "cursor,changed", rp->part->name);
      }
+
+   _edje_entry_imf_cursor_info_set(en);
+   _edje_entry_real_part_configure(rp);
 }
 
 static void