Check preedit_text first before analyzing surrounding_text 32/111032/2
authorJi-hoon Lee <dalton.lee@samsung.com>
Thu, 19 Jan 2017 07:50:52 +0000 (16:50 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 20 Jan 2017 00:16:30 +0000 (16:16 -0800)
Since the "cursor_position==0" condition is evaluated first,
the immodule considers autocapitalization is required even
when imcontext has preedit_text. Thus modified to check the
existence of preedit_text first.

Change-Id: Ibaa73a68617eaf08b8de6cade0ab8e28c2d83ea4

ism/extras/wayland_immodule/wayland_imcontext.c

index 6824950..eb0b1e2 100644 (file)
@@ -448,12 +448,12 @@ analyze_surrounding_text (Ecore_IMF_Context *ctx)
             break;
     }
 
-    if (imcontext->cursor_position == 0)
-        return EINA_TRUE;
-
     if (imcontext->preedit_text && strcmp (imcontext->preedit_text, "") != 0)
         return EINA_FALSE;
 
+    if (imcontext->cursor_position == 0)
+        return EINA_TRUE;
+
     ecore_imf_context_surrounding_get (ctx, &plain_str, &cursor_pos);
 
     if (!plain_str) goto done;