Fix bug autocapital doesn't work 89/44189/2
authorJihoon Kim <jihoon48.kim@samsung.com>
Fri, 17 Jul 2015 13:56:29 +0000 (22:56 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Fri, 17 Jul 2015 13:56:56 +0000 (22:56 +0900)
Change-Id: I553c26b9daf889b670581b6621ffa336a18d8002

ism/extras/efl_wsc/isf_wsc_context.h
ism/extras/efl_wsc/isf_wsc_efl.cpp

index 82e84c9..0da718a 100644 (file)
@@ -65,6 +65,7 @@ struct weescim
     uint32_t content_purpose;
     uint32_t surrounding_cursor;
     uint32_t return_key_type;
+    int      cursor_pos;
 
     Eina_Bool context_changed;
     Eina_Bool hw_kbd;
index 0a93980..9fe557d 100755 (executable)
@@ -103,6 +103,13 @@ _wsc_im_ctx_surrounding_text(void *data, struct wl_input_method_context *im_ctx,
 
     wsc->surrounding_text = strdup (text);
     wsc->surrounding_cursor = cursor;
+
+    if (wsc->cursor_pos != cursor) {
+        wsc->cursor_pos = cursor;
+        caps_mode_check (wsc->wsc_ctx, EINA_FALSE, EINA_TRUE);
+    }
+
+    LOGD ("text : '%s', cursor : %d", text, cursor);
 }
 
 static void
@@ -147,6 +154,8 @@ _wsc_im_ctx_invoke_action(void *data, struct wl_input_method_context *im_ctx, ui
     struct weescim *wsc = (weescim*)data;
     if (!wsc) return;
 
+    LOGD ("invoke action. button : %d", button);
+
     if (button != BTN_LEFT)
         return;
 
@@ -392,6 +401,7 @@ _wsc_im_activate(void *data, struct wl_input_method *input_method, struct wl_inp
     wsc->preedit_str = strdup ("");
     wsc->content_hint = WL_TEXT_INPUT_CONTENT_HINT_NONE;
     wsc->content_purpose = WL_TEXT_INPUT_CONTENT_PURPOSE_NORMAL;
+    wsc->cursor_pos = -1;
 
     if (wsc->language) {
         free (wsc->language);