Check if preedit string is empty before sending cursor_pos 66/110566/5
authorJi-hoon Lee <dalton.lee@samsung.com>
Tue, 17 Jan 2017 05:03:20 +0000 (14:03 +0900)
committerJi-hoon Lee <dalton.lee@samsung.com>
Wed, 18 Jan 2017 11:16:52 +0000 (03:16 -0800)
Currently we are not sending cursor_pos if we have preedit string,
but since the routine only checks whether the preedit_text is NULL,
so if the preedit_string is empty "" string, the ISE / IMEngine
will not get cursor_pos information properly. Thus added 'strlen()'
condition at the NULL checking 'if()' statement.

Change-Id: Ia2444d59f736b3474da02ca56bf55b0c8c1f53a3

ism/extras/wayland_immodule/wayland_imcontext.c

index 7bf4048..0b8529b 100644 (file)
@@ -2573,7 +2573,7 @@ wayland_im_context_cursor_position_set (Ecore_IMF_Context *ctx,
 
             set_autocapital (ctx);
 
-            if (!imcontext->preedit_text)
+            if (!imcontext->preedit_text || strlen(imcontext->preedit_text) == 0)
                 wl_text_input_set_cursor_position (imcontext->text_input, cursor_pos);
         }
     }