Modified to not to commit preedit_commit when empty 18/90918/2
authorJi-hoon Lee <dalton.lee@samsung.com>
Wed, 5 Oct 2016 02:43:10 +0000 (11:43 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Wed, 5 Oct 2016 04:54:06 +0000 (21:54 -0700)
Change-Id: I9fc7631a2053731cba832f5a0332de7d482f8c65

ism/extras/wayland_immodule/wayland_imcontext.c

index 6173740..3ac6687 100644 (file)
@@ -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