Fix reset sync issue 90/79990/1
authorInHong Han <inhong1.han@samsung.com>
Thu, 14 Jul 2016 02:11:59 +0000 (11:11 +0900)
committerInHong Han <inhong1.han@samsung.com>
Thu, 14 Jul 2016 02:23:39 +0000 (11:23 +0900)
Change-Id: Icdc7244cbc49a7ab52cb1ecdebb289f8b86bc1b5

ism/src/scim_helper.cpp

index d9a1753..6cc0b6d 100644 (file)
@@ -2014,7 +2014,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;
 
@@ -2047,6 +2059,7 @@ HelperAgent::get_surrounding_text (int maxlen_before, int maxlen_after, String &
         free (m_impl->surrounding_text);
         m_impl->surrounding_text = NULL;
     }
+#endif
 }
 
 /**