From: Jihoon Kim Date: Fri, 11 Aug 2017 09:35:36 +0000 (+0900) Subject: Fix lock issue when getting vconf value X-Git-Tag: submit/tizen/20170816.053248~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f1970e2dd536b0fdfb6f529ffd01f2d43f5e18f7;p=platform%2Fcore%2Fuifw%2Fe-mod-tizen-wl-textinput.git Fix lock issue when getting vconf value Calling vconf_get_XXX function in vconf changed callback leads to lock up. vconf_keynode_get_XXX function would be correct usage. Change-Id: I7cae861225c770d19900d9d072888546338486e9 Signed-off-by: Jihoon Kim --- diff --git a/src/e_mod_main.c b/src/e_mod_main.c index d171fd6..a657f19 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -315,23 +315,24 @@ _input_panel_hide(struct wl_client *client, struct wl_resource *resource, Eina_B static void _keyboard_mode_changed_cb(keynode_t *key, void* data) { - int val = 0; - if (vconf_get_bool(VCONFKEY_ISF_HW_KEYBOARD_INPUT_DETECTED, &val) == 0) + bool val = vconf_keynode_get_bool(key); + LOGD("keyboard mode : %d\n", val); + + if (val == false) { - if (val == 0) - { - /* Switching to S/W keyboard mode, hide input panel since it could be displaying candidate only */ - if (g_disable_show_panel && g_text_input && g_text_input->resource && g_client) - _input_panel_hide(g_client, g_text_input->resource, EINA_FALSE); - g_disable_show_panel = EINA_FALSE; - } - else - { - /* Switching to H/W keyboard mode, hide input panel only if there is no candidate */ - if (!g_show_state_candidate && g_text_input && g_text_input->resource && g_client) - _input_panel_hide(g_client, g_text_input->resource, EINA_FALSE); - g_disable_show_panel = EINA_TRUE; - } + /* Switching to S/W keyboard mode, hide input panel since it could be displaying candidate only */ + if (g_disable_show_panel && g_text_input && g_text_input->resource && g_client) + _input_panel_hide(g_client, g_text_input->resource, EINA_FALSE); + + g_disable_show_panel = EINA_FALSE; + } + else + { + /* Switching to H/W keyboard mode, hide input panel only if there is no candidate */ + if (!g_show_state_candidate && g_text_input && g_text_input->resource && g_client) + _input_panel_hide(g_client, g_text_input->resource, EINA_FALSE); + + g_disable_show_panel = EINA_TRUE; } } @@ -339,7 +340,8 @@ static void _display_language_changed_cb(keynode_t *key, void* data) { int loop; - char *language = vconf_get_str(VCONFKEY_LANGSET); + char *language = vconf_keynode_get_str(key); + LOGD("language : %s\n", language); /* Just in case we did not find any matching language string */ g_keymap_index = 0; @@ -352,7 +354,6 @@ _display_language_changed_cb(keynode_t *key, void* data) g_keymap_index = loop; } } - free(language); } /* We do not want to change the current keymap related behavior in TV profile for now */ if (!_TV)