static unsigned int scim_x11_keymask_scim_to_x11 (Display *display, uint16 scimkeymask);
static XKeyEvent createKeyEvent (bool press, int keycode, int modifiers, bool fake);
static void send_x_key_event (const KeyEvent &key, bool fake);
+static void _hide_preedit_string (int context, bool update_preedit);
static void attach_instance (const IMEngineInstancePointer &si);
ecore_imf_context_input_panel_hide (ctx);
if (context_scim->impl->need_commit_preedit) {
- panel_slot_hide_preedit_string (context_scim->id);
+ _hide_preedit_string (context_scim->id, false);
if (wstr.length ()) {
ecore_imf_context_commit_event_add (context_scim->ctx, utf8_wcstombs (wstr).c_str ());
_panel_client.send ();
if (context_scim->impl->need_commit_preedit) {
- panel_slot_hide_preedit_string (context_scim->id);
+ _hide_preedit_string (context_scim->id, false);
if (wstr.length ()) {
ecore_imf_context_commit_event_add (context_scim->ctx, utf8_wcstombs (wstr).c_str ());
autoperiod_insert (ic->ctx);
if (ic->impl->need_commit_preedit)
- panel_slot_hide_preedit_string (ic->id);
+ _hide_preedit_string (ic->id, false);
ecore_imf_context_commit_event_add (ic->ctx, utf8_wcstombs (wstr).c_str ());
ecore_imf_context_event_callback_call (ic->ctx, ECORE_IMF_CALLBACK_COMMIT, (void *)utf8_wcstombs (wstr).c_str ());
}
if (ic && ic->impl) {
WideString wstr = ic->impl->preedit_string;
if (ic->impl->need_commit_preedit) {
- panel_slot_hide_preedit_string (ic->id);
+ _hide_preedit_string (ic->id, false);
if (wstr.length ()) {
ecore_imf_context_commit_event_add (ic->ctx, utf8_wcstombs (wstr).c_str ());
}
static void
-panel_slot_hide_preedit_string (int context)
+_hide_preedit_string (int context, bool update_preedit)
{
SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
emit = true;
}
if (ic->impl->use_preedit) {
- if (emit) {
+ if (update_preedit && emit) {
ecore_imf_context_preedit_changed_event_add (ic->ctx);
ecore_imf_context_event_callback_call (ic->ctx, ECORE_IMF_CALLBACK_PREEDIT_CHANGED, NULL);
}
}
static void
+panel_slot_hide_preedit_string (int context)
+{
+ SCIM_DEBUG_FRONTEND(1) << __FUNCTION__ << "...\n";
+
+ _hide_preedit_string (context, true);
+}
+
+static void
panel_slot_update_preedit_string (int context,
const WideString &str,
const AttributeList &attrs,
const String &uuid);
static void attach_instance (const IMEngineInstancePointer &si);
+static void _hide_preedit_string (int context,
+ bool update_preedit);
/* slot functions */
static void slot_show_preedit_string (IMEngineInstanceBase *si);
if (context_scim->impl->need_commit_preedit)
{
- panel_slot_hide_preedit_string (context_scim->id);
+ _hide_preedit_string (context_scim->id, false);
if (wstr.length ())
g_signal_emit_by_name (context_scim, "commit", utf8_wcstombs (wstr).c_str ());
//sehwan added
if (context_scim->impl->need_commit_preedit)
{
- panel_slot_hide_preedit_string (context_scim->id);
+ _hide_preedit_string (context_scim->id, false);
if (wstr.length ())
g_signal_emit_by_name (context_scim, "commit", utf8_wcstombs (wstr).c_str ());
WideString wstr = ic->impl->preedit_string;
if (ic->impl->need_commit_preedit)
{
- panel_slot_hide_preedit_string (ic->id);
+ _hide_preedit_string (ic->id, false);
if (wstr.length ())
g_signal_emit_by_name (ic, "commit", utf8_wcstombs (wstr).c_str ());
}
static void
-panel_slot_hide_preedit_string (int context)
+_hide_preedit_string (int context, bool update_preedit)
{
GtkIMContextSCIM *ic = find_ic (context);
SCIM_DEBUG_FRONTEND(1) << "panel_slot_hide_preedit_string context=" << context << "\n";
emit = true;
}
if (ic->impl->use_preedit) {
- if (emit) g_signal_emit_by_name (ic, "preedit-changed");
+ if (update_preedit && emit) g_signal_emit_by_name (ic, "preedit-changed");
if (ic->impl->preedit_started) {
g_signal_emit_by_name (ic, "preedit-end");
ic->impl->preedit_started = false;
}
static void
+panel_slot_hide_preedit_string (int context)
+{
+ _hide_preedit_string (context, true);
+}
+
+static void
panel_slot_update_preedit_string (int context,
const WideString &str,
const AttributeList &attrs,