From 08faf35c663d40a5caa9e71f46c3aad7620a5023 Mon Sep 17 00:00:00 2001 From: "sungwook79.park" Date: Tue, 20 Jun 2017 15:14:28 +0900 Subject: [PATCH] Fix bug of candidateview when received mixed candidate from smartreply and engine Change-Id: Idb7eb6edff6acdb35b2e2bfb9ca1ca771b2a4ba2 Signed-off-by: sungwook79.park --- src/ise.cpp | 21 ++++++++++++++++++++- 1 file changed, 20 insertions(+), 1 deletion(-) diff --git a/src/ise.cpp b/src/ise.cpp index eab719e..6c76930 100644 --- a/src/ise.cpp +++ b/src/ise.cpp @@ -90,6 +90,7 @@ static Ecore_Timer *g_softcandidate_hide_timer = NULL; extern sclboolean g_setting_window_open_status; static int g_ic = 0; +static int g_ic_smartreply = -1; KEYBOARD_STATE g_keyboard_state = { 0, @@ -206,7 +207,9 @@ static void _input_smartreply_notify_cb(void *user_data) candidate_strings.push_back(string(candidate)); } } + g_ic_smartreply = g_ic; g_smartrply_reply_exist = true; + ise_app_candidate_show(); g_softcandidate_string = candidate_strings; ise_update_table(candidate_strings); @@ -1616,6 +1619,9 @@ ise_app_candidate_hide() return; } + if (g_ic_smartreply != -1) + return; + add_softcandidate_hide_timer(); if (g_ui) { g_ui->set_custom_starting_coordinates(0, 0); @@ -1783,7 +1789,8 @@ void ise_get_language_locale(char **locale) void ise_update_table(const vector &vec_str) { - create_softcandidate(); + if (!g_candidate || !g_softcandidate_show) + create_softcandidate(); if (g_candidate) { g_candidate->update(vec_str); @@ -1963,6 +1970,7 @@ static void ime_app_hide_cb(int ic, void *user_data) #ifdef HAVE_CBHM g_set_mime_type = FALSE; #endif + g_ic_smartreply = -1; } static void ime_app_return_key_type_set_cb(Ecore_IMF_Input_Panel_Return_Key_Type type, void *user_data) @@ -2024,6 +2032,7 @@ static void ime_app_focus_out_cb(int context_id, void *user_data) #endif g_smartrply_reply_exist = false; input_smartreply_deinit(); + g_ic_smartreply = -1; } static void ime_app_layout_set_cb(Ecore_IMF_Input_Panel_Layout layout, void *user_data) @@ -2154,6 +2163,16 @@ static void ime_app_lookup_table_changed_cb(Eina_List *list, void *user_data) } } + if (g_smartrply_reply_exist) { + if (candidate_strings[0] == "#" && candidate_strings[1] == "$") { + char *text; + int cursor; + ime_get_surrounding_text(0, 0, &text, &cursor); + if (cursor == 0) + return; + } + } + g_softcandidate_string = candidate_strings; ise_update_table(candidate_strings); } -- 2.7.4