Modified to not to commit text twice in TV 54/250954/1
authorInHong Han <inhong1.han@samsung.com>
Wed, 6 Jan 2021 02:54:08 +0000 (11:54 +0900)
committerInHong Han <inhong1.han@samsung.com>
Wed, 6 Jan 2021 05:27:17 +0000 (14:27 +0900)
Change-Id: I6bde56f7537c302544cfc47e304569ef33460bc1

ism/src/scim_helper.cpp

index 5de663c..e1d9b32 100644 (file)
@@ -1177,26 +1177,27 @@ HelperAgent::handle_message (MessageItem *message)
             m_impl->signal_process_key_event(this, subclass->get_key_ref(), ret);
             m_impl->signal_process_key_event_with_keycode(this, subclass->get_key_ref(), keycode_ret, subclass->get_keycode_ref());
 
-            if (ret != 0 && keycode_ret != 0) {
+            if (ret != 0 || keycode_ret != 0) {
                 ret = 1;
                 m_impl->process_key_event_done (subclass->get_key_ref(), ret, subclass->get_serial_ref());
-            } else {
-                if (!(subclass->get_key_ref().get_key_string().compare("KeyRelease+XF86Back") == 0 ||
-                      subclass->get_key_ref().get_key_string().compare("XF86Back") == 0)) {
-                        if (m_impl->engine_loader_flag) {
-                            m_impl->signal_process_key_event_with_imengine(this, subclass->get_key_ref(), subclass->get_serial_ref());
-                            SECURE_LOGD ("imengine process key %d", subclass->get_key_ref().code);
-                        } else {
-                            if (!m_impl->si.null ()) {
-                                ret = m_impl->si->process_key_event (subclass->get_key_ref());
-                                SECURE_LOGD ("imengine(%s) process key %d return %d", m_impl->si->get_factory_uuid().c_str(),
-                                    subclass->get_key_ref().code, ret);
-                            }
-                            m_impl->process_key_event_done (subclass->get_key_ref(), ret, subclass->get_serial_ref());
-                        }
-                } else
-                    m_impl->process_key_event_done (subclass->get_key_ref(), ret, subclass->get_serial_ref());
+                break;
             }
+
+            if (!(subclass->get_key_ref().get_key_string().compare("KeyRelease+XF86Back") == 0 ||
+                  subclass->get_key_ref().get_key_string().compare("XF86Back") == 0)) {
+                if (m_impl->engine_loader_flag) {
+                    m_impl->signal_process_key_event_with_imengine(this, subclass->get_key_ref(), subclass->get_serial_ref());
+                    SECURE_LOGD ("imengine process key %d", subclass->get_key_ref().code);
+                } else {
+                    if (!m_impl->si.null ()) {
+                        ret = m_impl->si->process_key_event (subclass->get_key_ref());
+                        SECURE_LOGD ("imengine(%s) process key %d return %d", m_impl->si->get_factory_uuid().c_str(),
+                            subclass->get_key_ref().code, ret);
+                    }
+                    m_impl->process_key_event_done (subclass->get_key_ref(), ret, subclass->get_serial_ref());
+                }
+            } else
+                m_impl->process_key_event_done (subclass->get_key_ref(), ret, subclass->get_serial_ref());
             break;
         }
         case ISM_TRANS_CMD_SET_LAYOUT: