summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWooHyun Jung <woohyun0705@gmail.com>2013-01-07 11:17:55 +0000
committerWooHyun Jung <woohyun0705@gmail.com>2013-01-07 11:17:55 +0000
commit8e72f77b5f9bbf21e456bb0d3d50bc76333472ca (patch)
tree309d726202d30fc2b5017015dada80f9dd774da5 /src
parentbdfe30ea8df6cb211d91936b44e26dc0870c4ddf (diff)
edje/edje_entry : When preediting text is removed by filter callback, committing is useless. So I added some codes for skipping that committing.
SVN revision: 82339
Diffstat (limited to 'src')
-rw-r--r--src/lib/edje/edje_entry.c24
1 files changed, 22 insertions, 2 deletions
diff --git a/src/lib/edje/edje_entry.c b/src/lib/edje/edje_entry.c
index b9f767b25e..dbb592ba7d 100644
--- a/src/lib/edje/edje_entry.c
+++ b/src/lib/edje/edje_entry.c
@@ -43,6 +43,7 @@ struct _Entry
43 43
44#ifdef HAVE_ECORE_IMF 44#ifdef HAVE_ECORE_IMF
45 Eina_Bool have_preedit : 1; 45 Eina_Bool have_preedit : 1;
46 Eina_Bool commit_cancel : 1; // For skipping useless commit
46 Ecore_IMF_Context *imf_context; 47 Ecore_IMF_Context *imf_context;
47#endif 48#endif
48}; 49};
@@ -202,6 +203,11 @@ _text_filter_markup_prepend_internal(Entry *en, Evas_Textblock_Cursor *c, char *
202 if (!text) break; 203 if (!text) break;
203 } 204 }
204 } 205 }
206#ifdef HAVE_ECORE_IMF
207 // For skipping useless commit
208 if (en->have_preedit && (!text || !strcmp(text, "")))
209 en->commit_cancel = EINA_TRUE;
210#endif
205 if (text) 211 if (text)
206 { 212 {
207 evas_object_textblock_text_markup_prepend(c, text); 213 evas_object_textblock_text_markup_prepend(c, text);
@@ -2320,6 +2326,8 @@ _edje_entry_real_part_init(Edje_Real_Part *rp)
2320#ifdef HAVE_ECORE_IMF 2326#ifdef HAVE_ECORE_IMF
2321 _edje_need_imf(); 2327 _edje_need_imf();
2322 2328
2329 en->commit_cancel = EINA_FALSE;
2330
2323 edje_object_signal_callback_add(rp->edje->obj, "focus,part,in", rp->part->name, _edje_entry_focus_in_cb, rp); 2331 edje_object_signal_callback_add(rp->edje->obj, "focus,part,in", rp->part->name, _edje_entry_focus_in_cb, rp);
2324 edje_object_signal_callback_add(rp->edje->obj, "focus,part,out", rp->part->name, _edje_entry_focus_out_cb, rp); 2332 edje_object_signal_callback_add(rp->edje->obj, "focus,part,out", rp->part->name, _edje_entry_focus_out_cb, rp);
2325 2333
@@ -3574,6 +3582,8 @@ _edje_entry_imf_context_reset(Edje_Real_Part *rp)
3574 if (!en) return; 3582 if (!en) return;
3575 if (en->imf_context) 3583 if (en->imf_context)
3576 ecore_imf_context_reset(en->imf_context); 3584 ecore_imf_context_reset(en->imf_context);
3585 if (en->commit_cancel)
3586 en->commit_cancel = EINA_FALSE;
3577#else 3587#else
3578 (void)rp; 3588 (void)rp;
3579#endif 3589#endif
@@ -3672,11 +3682,16 @@ _edje_entry_imf_event_commit_cb(void *data, Ecore_IMF_Context *ctx EINA_UNUSED,
3672 3682
3673 start_pos = evas_textblock_cursor_pos_get(en->cursor); 3683 start_pos = evas_textblock_cursor_pos_get(en->cursor);
3674 3684
3675#ifdef HAVE_ECORE_IMF
3676 /* delete preedit characters */ 3685 /* delete preedit characters */
3677 _preedit_del(en); 3686 _preedit_del(en);
3678 _preedit_clear(en); 3687 _preedit_clear(en);
3679#endif 3688
3689 // Skipping commit process when it is useless
3690 if (en->commit_cancel)
3691 {
3692 en->commit_cancel = EINA_FALSE;
3693 return;
3694 }
3680 3695
3681 if ((rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD) && 3696 if ((rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD) &&
3682 _edje_password_show_last) 3697 _edje_password_show_last)
@@ -3824,6 +3839,11 @@ _edje_entry_imf_event_preedit_changed_cb(void *data, Ecore_IMF_Context *ctx EINA
3824 { 3839 {
3825 eina_strbuf_append(buf, preedit_string); 3840 eina_strbuf_append(buf, preedit_string);
3826 } 3841 }
3842
3843 // For skipping useless commit
3844 if (!preedit_end_state)
3845 en->have_preedit = EINA_TRUE;
3846
3827 if ((rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD) && 3847 if ((rp->part->entry_mode == EDJE_ENTRY_EDIT_MODE_PASSWORD) &&
3828 _edje_password_show_last) 3848 _edje_password_show_last)
3829 { 3849 {