diff options
author | Jihoon Kim <jihoon48.kim@samsung.com> | 2016-09-09 17:46:08 +0900 |
---|---|---|
committer | Jihoon Kim <jihoon48.kim@samsung.com> | 2016-09-09 17:46:23 +0900 |
commit | bb09d41865c09e6eb1b9c3beb20e8669f5a5a706 (patch) | |
tree | cc05155518d095819c56dec2f5d5c8ce11659a31 | |
parent | 07a7cb8e313bc6718c31433bca1ee9be9988cd05 (diff) | |
download | isf-bb09d41865c09e6eb1b9c3beb20e8669f5a5a706.tar.gz isf-bb09d41865c09e6eb1b9c3beb20e8669f5a5a706.tar.bz2 isf-bb09d41865c09e6eb1b9c3beb20e8669f5a5a706.zip |
clear preedit text before commiting text
Change-Id: Id4e5b34c8019ad8e5efdf799e14431f34de1ab53
Signed-off-by: Jihoon Kim <jihoon48.kim@samsung.com>
-rw-r--r-- | ism/extras/wayland_immodule/wayland_imcontext.c | 20 |
1 files changed, 14 insertions, 6 deletions
diff --git a/ism/extras/wayland_immodule/wayland_imcontext.c b/ism/extras/wayland_immodule/wayland_imcontext.c index e0ac9cc8..6350b2ca 100644 --- a/ism/extras/wayland_immodule/wayland_imcontext.c +++ b/ism/extras/wayland_immodule/wayland_imcontext.c @@ -503,7 +503,7 @@ check_serial(WaylandIMContext *imcontext, uint32_t serial) } static void -clear_preedit(WaylandIMContext *imcontext) +clear_preedit_text(WaylandIMContext *imcontext) { Ecore_IMF_Preedit_Attr *attr = NULL; @@ -514,11 +514,6 @@ clear_preedit(WaylandIMContext *imcontext) imcontext->preedit_text = NULL; } - if (imcontext->preedit_commit) { - free(imcontext->preedit_commit); - imcontext->preedit_commit = NULL; - } - if (imcontext->preedit_attrs) { EINA_LIST_FREE(imcontext->preedit_attrs, attr) free(attr); @@ -528,6 +523,17 @@ clear_preedit(WaylandIMContext *imcontext) } static void +clear_preedit(WaylandIMContext *imcontext) +{ + clear_preedit_text(imcontext); + + if (imcontext->preedit_commit) { + free(imcontext->preedit_commit); + imcontext->preedit_commit = NULL; + } +} + +static void text_input_commit_string(void *data, struct wl_text_input *text_input EINA_UNUSED, uint32_t serial, @@ -573,6 +579,8 @@ commit_preedit(WaylandIMContext *imcontext) if (!imcontext->ctx) return; + clear_preedit_text(imcontext); + ecore_imf_context_preedit_changed_event_add(imcontext->ctx); ecore_imf_context_event_callback_call(imcontext->ctx, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, |