From e12bf9a298d5899cb7aadaef602efea216b2541b Mon Sep 17 00:00:00 2001 From: InHong Han Date: Thu, 18 Jan 2018 11:51:08 +0900 Subject: [PATCH] Fix the issue that vconf_changed_cb is called later than filter event when the keyboard mode is changed Change-Id: I0d0cdb4e2eed58fc878198fee286ec1a15c81b80 (cherry picked from commit 4369142dae2c57e2ffcfb9e78f2b8e3f4cbc8751) --- ism/extras/wayland_immodule/wayland_imcontext.c | 22 ++++++++++++++-------- 1 file changed, 14 insertions(+), 8 deletions(-) diff --git a/ism/extras/wayland_immodule/wayland_imcontext.c b/ism/extras/wayland_immodule/wayland_imcontext.c index 5f53d78..35bbbbb 100644 --- a/ism/extras/wayland_immodule/wayland_imcontext.c +++ b/ism/extras/wayland_immodule/wayland_imcontext.c @@ -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; } } -- 2.7.4