From: InHong Han Date: Wed, 22 Nov 2017 10:25:10 +0000 (+0900) Subject: Modify the duplicated commit events when the context_reset is called twice continuosly X-Git-Tag: accepted/tizen/unified/20171123.065828~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F80%2F161280%2F1;p=platform%2Fcore%2Fuifw%2Fisf.git Modify the duplicated commit events when the context_reset is called twice continuosly Change-Id: I938cc033a2eb680a44b441dd161309d17f44a26b --- 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;