Fix Remote Input bug 98/116098/4
authorSungmin Kwak <sungmin.kwak@samsung.com>
Thu, 23 Feb 2017 02:36:07 +0000 (11:36 +0900)
committerJihoon Kim <jihoon48.kim@samsung.com>
Thu, 23 Feb 2017 10:05:46 +0000 (02:05 -0800)
In case of REMOTE → LOCAL, clear preedit variables after committing it.

Change-Id: I38d8a2925dd7170b5544720a377019b8ec62d2b0

ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp

index 63e572e..580ccb3 100644 (file)
@@ -1029,11 +1029,13 @@ check_input_resource (WSCContextISF* wsc_ctx, Input_Resource input_res)
 #endif
 
         if (context_scim->impl->input_resource == INPUT_RESOURCE_REMOTE && input_res == INPUT_RESOURCE_LOCAL) {
-            WideString wstr = context_scim->impl->preedit_string;
-
             if (context_scim->impl->need_commit_preedit) {
+                WideString wstr = context_scim->impl->preedit_string;
                 _hide_preedit_string (context_scim->id, false);
                 wsc_context_commit_string (context_scim, utf8_wcstombs (wstr).c_str ());
+
+                context_scim->impl->need_commit_preedit = false;
+                context_scim->impl->preedit_string.clear ();
             }
 
             if (_resource_check_timer)
@@ -1408,7 +1410,7 @@ isf_wsc_context_send_surrounding_text (WSCContextISF* wsc_ctx, const char *text,
         return;
 
     if ((!context_scim->impl->init_remote_surrounding_text || strcmp (conv_text, text) != 0 || context_scim->impl->cursor_pos != cursor)) {
-        LOGD("remote surrounding text : %s\n", text);
+        SECURE_LOGD("remote surrounding text : \"%s\"\n", text);
         context_scim->impl->surrounding_text = utf8_mbstowcs (String (text));
         context_scim->impl->cursor_pos = cursor;
 
@@ -2370,9 +2372,6 @@ panel_slot_commit_string (int context, const WideString &wstr, bool remote_mode)
             }
             check_input_resource (ic, INPUT_RESOURCE_REMOTE);
 
-            ic->impl->need_commit_preedit = false;
-            ic->impl->preedit_string.clear ();
-
             if (ic->impl->panel_layout == ECORE_IMF_INPUT_PANEL_LAYOUT_URL)
                 wsc_context_delete_surrounding (ic, -ic->impl->cursor_pos, ic->impl->surrounding_text.length ());
         } else {