From: InHong Han Date: Thu, 14 Jul 2016 07:22:50 +0000 (+0900) Subject: Fix reset sync issue X-Git-Tag: accepted/tizen/common/20160810.161735~5 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=refs%2Fchanges%2F36%2F80036%2F7;p=platform%2Fcore%2Fuifw%2Fisf.git Fix reset sync issue Change-Id: If72ba9c4f9676f15bc68b2c630af686352e92355 --- diff --git a/ism/extras/wayland_immodule/wayland_imcontext.c b/ism/extras/wayland_immodule/wayland_imcontext.c index cf623b6..f604245 100644 --- a/ism/extras/wayland_immodule/wayland_imcontext.c +++ b/ism/extras/wayland_immodule/wayland_imcontext.c @@ -485,31 +485,6 @@ update_state(WaylandIMContext *imcontext) } } -#if !(ENABLE_RESET_DONE_FUNC) -static Eina_Bool -check_serial(WaylandIMContext *imcontext, uint32_t serial) -{ - Ecore_IMF_Preedit_Attr *attr; - - if ((imcontext->serial - serial) > - (imcontext->serial - imcontext->reset_serial)) { - LOGD("outdated serial: %u, current: %u, reset: %u", - serial, imcontext->serial, imcontext->reset_serial); - - imcontext->pending_preedit.cursor = 0; - - if (imcontext->pending_preedit.attrs) { - EINA_LIST_FREE(imcontext->pending_preedit.attrs, attr) free(attr); - imcontext->pending_preedit.attrs = NULL; - } - - return EINA_FALSE; - } - - return EINA_TRUE; -} -#endif - static void clear_preedit(WaylandIMContext *imcontext) { @@ -554,10 +529,6 @@ text_input_commit_string(void *data, if (!imcontext->ctx) return; -#if !(ENABLE_RESET_DONE_FUNC) - if (!check_serial(imcontext, serial)) - return; -#endif if (old_preedit) { ecore_imf_context_preedit_end_event_add(imcontext->ctx); @@ -981,10 +952,7 @@ text_input_preedit_string(void *data, SECURE_LOGD("preedit event (text: '%s', current pre-edit: '%s')", text, imcontext->preedit_text ? imcontext->preedit_text : ""); -#if !(ENABLE_RESET_DONE_FUNC) - if (!check_serial(imcontext, serial)) - return; -#endif + old_preedit = imcontext->preedit_text && strlen(imcontext->preedit_text) > 0; @@ -1914,6 +1882,7 @@ wayland_im_context_hide(Ecore_IMF_Context *ctx) _input_panel_hide(ctx, EINA_FALSE); } +#if !(ENABLE_GRAB_KEYBOARD) static unsigned int _ecore_imf_lock_to_ecore_key_modifier(unsigned int locks) { @@ -1958,6 +1927,7 @@ _ecore_imf_modifier_to_ecore_key_modifier(Ecore_IMF_Keyboard_Modifiers modifiers return mask; } +#endif EAPI Eina_Bool wayland_im_context_filter_event(Ecore_IMF_Context *ctx, diff --git a/ism/src/scim_helper.cpp b/ism/src/scim_helper.cpp index 944ee61..a850514 100644 --- a/ism/src/scim_helper.cpp +++ b/ism/src/scim_helper.cpp @@ -1967,7 +1967,19 @@ void HelperAgent::get_surrounding_text (int maxlen_before, int maxlen_after, String &text, int &cursor) { LOGD (""); - +#ifdef _TV + if (m_impl->socket_active.is_connected () && (m_impl->need_update_surrounding_text == 0)) { + m_impl->send.clear (); + m_impl->send.put_command (SCIM_TRANS_CMD_REQUEST); + m_impl->send.put_data (m_impl->magic_active); + m_impl->send.put_command (SCIM_TRANS_CMD_GET_SURROUNDING_TEXT); + m_impl->send.put_data (""); + m_impl->send.put_data (maxlen_before); + m_impl->send.put_data (maxlen_after); + m_impl->send.write_to_socket (m_impl->socket_active, m_impl->magic_active); + } + m_impl->need_update_surrounding_text++; +#else if (!m_impl->socket_active.is_connected ()) return; @@ -2001,6 +2013,7 @@ HelperAgent::get_surrounding_text (int maxlen_before, int maxlen_after, String & free (m_impl->surrounding_text); m_impl->surrounding_text = NULL; } +#endif } /**