char* surrounding_text;
uint32 cursor_pos;
+ bool need_update_surrounding_text;
HelperAgentSignalVoid signal_exit;
HelperAgentSignalVoid signal_attach_input_context;
HelperAgentSignalUintVoid signal_check_option_window;
public:
- HelperAgentImpl (HelperAgent* thiz) : focused_ic ((uint32) -1), thiz (thiz), surrounding_text (NULL), cursor_pos (0) {
+ HelperAgentImpl (HelperAgent* thiz) : focused_ic ((uint32) -1), thiz (thiz), surrounding_text (NULL), cursor_pos (0), need_update_surrounding_text(false) {
}
m_impl->surrounding_text = strdup (text.c_str ());
m_impl->cursor_pos = cursor;
LOGD ("%s, %d", m_impl->surrounding_text, m_impl->cursor_pos);
- m_impl->signal_update_surrounding_text (this, ic, text, (int) cursor);
+ if (m_impl->need_update_surrounding_text) {
+ m_impl->need_update_surrounding_text = false;
+ m_impl->signal_update_surrounding_text (this, ic, text, (int) cursor);
+ }
}
else
LOGW ("wrong format of transaction\n");
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 = true;
}
/**