From dc4956eb5c0af06796018fa641ee192cb6a71bd8 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Wed, 5 Oct 2016 11:43:10 +0900 Subject: [PATCH] Modified to not to commit preedit_commit when empty Change-Id: I9fc7631a2053731cba832f5a0332de7d482f8c65 --- ism/extras/wayland_immodule/wayland_imcontext.c | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/ism/extras/wayland_immodule/wayland_imcontext.c b/ism/extras/wayland_immodule/wayland_imcontext.c index 6173740..3ac6687 100644 --- a/ism/extras/wayland_immodule/wayland_imcontext.c +++ b/ism/extras/wayland_immodule/wayland_imcontext.c @@ -561,8 +561,7 @@ text_input_commit_string(void *data, if (!check_serial(imcontext, serial)) return; - if (old_preedit) - { + if (old_preedit) { ecore_imf_context_preedit_end_event_add(imcontext->ctx); ecore_imf_context_event_callback_call(imcontext->ctx, ECORE_IMF_CALLBACK_PREEDIT_END, @@ -596,11 +595,13 @@ commit_preedit(WaylandIMContext *imcontext) ecore_imf_context_event_callback_call(imcontext->ctx, ECORE_IMF_CALLBACK_PREEDIT_END, NULL); - ecore_imf_context_commit_event_add(imcontext->ctx, - imcontext->preedit_commit); - ecore_imf_context_event_callback_call(imcontext->ctx, - ECORE_IMF_CALLBACK_COMMIT, - (void *)imcontext->preedit_commit); + if (strlen(imcontext->preedit_commit) > 0) { + ecore_imf_context_commit_event_add(imcontext->ctx, + imcontext->preedit_commit); + ecore_imf_context_event_callback_call(imcontext->ctx, + ECORE_IMF_CALLBACK_COMMIT, + (void *)imcontext->preedit_commit); + } } static void -- 2.7.4