From 517179a795758d3f775f072fabd022b1b883ed5f Mon Sep 17 00:00:00 2001 From: InHong Han Date: Wed, 22 Nov 2017 19:25:10 +0900 Subject: [PATCH] Modify the duplicated commit events when the context_reset is called twice continuosly Change-Id: I938cc033a2eb680a44b441dd161309d17f44a26b --- ism/extras/wayland_immodule/wayland_imcontext.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/ism/extras/wayland_immodule/wayland_imcontext.c b/ism/extras/wayland_immodule/wayland_imcontext.c index b7da7c1..0026552 100644 --- a/ism/extras/wayland_immodule/wayland_imcontext.c +++ b/ism/extras/wayland_immodule/wayland_imcontext.c @@ -1264,11 +1264,15 @@ commit_preedit(WaylandIMContext *imcontext) ECORE_IMF_CALLBACK_PREEDIT_END, NULL); if (commit_len > 0) { + char *commit_str = NULL; + commit_str = strdup(imcontext->preedit_commit); + clear_preedit(imcontext); ecore_imf_context_commit_event_add(imcontext->ctx, - imcontext->preedit_commit); + commit_str); ecore_imf_context_event_callback_call(imcontext->ctx, ECORE_IMF_CALLBACK_COMMIT, - (void *)imcontext->preedit_commit); + (void *)commit_str); + free(commit_str); } } @@ -2703,7 +2707,6 @@ wayland_im_context_reset(Ecore_IMF_Context *ctx) Eina_Bool preedit_empty = check_preedit_empty(imcontext); commit_preedit (imcontext); - clear_preedit(imcontext); if (!imcontext->input) return; -- 2.7.4