}
}
-#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)
{
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);
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;
_input_panel_hide(ctx, EINA_FALSE);
}
+#if !(ENABLE_GRAB_KEYBOARD)
static unsigned int
_ecore_imf_lock_to_ecore_key_modifier(unsigned int locks)
{
return mask;
}
+#endif
EAPI Eina_Bool
wayland_im_context_filter_event(Ecore_IMF_Context *ctx,
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;
free (m_impl->surrounding_text);
m_impl->surrounding_text = NULL;
}
+#endif
}
/**