From e17833f26d41575158d6094e27d50e6adfe4bd1f Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Sat, 7 Jan 2017 17:48:00 +0900 Subject: [PATCH] Fix blink issue when reset is called Consecutive empty preedit and commit occurs blink. Change-Id: I35e271dc4ccdc6f7223cf2c3ce016e4ecc1ef4fd Signed-off-by: Jihoon Kim --- ism/extras/wayland_immodule/wayland_imcontext.c | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/ism/extras/wayland_immodule/wayland_imcontext.c b/ism/extras/wayland_immodule/wayland_imcontext.c index 05d667c..48f739e 100644 --- a/ism/extras/wayland_immodule/wayland_imcontext.c +++ b/ism/extras/wayland_immodule/wayland_imcontext.c @@ -1187,16 +1187,20 @@ commit_preedit(WaylandIMContext *imcontext) 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, - NULL); + size_t commit_len = strlen(imcontext->preedit_commit); + + if (commit_len == 0) { + ecore_imf_context_preedit_changed_event_add(imcontext->ctx); + ecore_imf_context_event_callback_call(imcontext->ctx, + ECORE_IMF_CALLBACK_PREEDIT_CHANGED, + NULL); + } ecore_imf_context_preedit_end_event_add(imcontext->ctx); ecore_imf_context_event_callback_call(imcontext->ctx, ECORE_IMF_CALLBACK_PREEDIT_END, NULL); - if (strlen(imcontext->preedit_commit) > 0) { + if (commit_len > 0) { ecore_imf_context_commit_event_add(imcontext->ctx, imcontext->preedit_commit); ecore_imf_context_event_callback_call(imcontext->ctx, -- 2.7.4