Fix the issue that vconf_changed_cb is called later than filter event when the keyboa... 09/167509/1
authorInHong Han <inhong1.han@samsung.com>
Thu, 18 Jan 2018 02:51:08 +0000 (11:51 +0900)
committerInHong Han <inhong1.han@samsung.com>
Thu, 18 Jan 2018 05:15:21 +0000 (05:15 +0000)
Change-Id: I0d0cdb4e2eed58fc878198fee286ec1a15c81b80
(cherry picked from commit 4369142dae2c57e2ffcfb9e78f2b8e3f4cbc8751)

ism/extras/wayland_immodule/wayland_imcontext.c

index 5f53d78..35bbbbb 100644 (file)
@@ -3120,15 +3120,21 @@ wayland_im_context_filter_event(Ecore_IMF_Context    *ctx,
         }
 
         if (_TV) {
-            if (strcmp (ecore_key_ev.keyname, "Return") == 0 && type == ECORE_IMF_EVENT_KEY_DOWN && key_dev_subclass == ECORE_DEVICE_SUBCLASS_REMOCON && hw_keyboard_mode == EINA_TRUE) {
-                LOGD ("Changed keyboard mode from H/W to S/W ");
-                hw_keyboard_mode = EINA_FALSE;
-                vconf_set_bool (VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, 0);
-
-                if (ecore_imf_context_input_panel_enabled_get (ctx)) {
-                    ecore_imf_context_input_panel_show (ctx);
+            if (strcmp (ecore_key_ev.keyname, "Return") == 0 && type == ECORE_IMF_EVENT_KEY_DOWN && key_dev_subclass == ECORE_DEVICE_SUBCLASS_REMOCON) {
+                int val;
+
+                if (vconf_get_bool (VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, &val) == 0) {
+                    if (val) {
+                        LOGD ("Changed keyboard mode from H/W to S/W ");
+                        hw_keyboard_mode = EINA_FALSE;
+                        vconf_set_bool (VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, 0);
+
+                        if (ecore_imf_context_input_panel_enabled_get (ctx)) {
+                            ecore_imf_context_input_panel_show (ctx);
+                        }
+                        return EINA_TRUE;
+                    }
                 }
-                return EINA_TRUE;
             }
         }