From 8c1776d17702a9e59535cd66fc09e8a1fd2e5685 Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Mon, 18 Apr 2016 14:51:46 +0900 Subject: [PATCH] ecore_imf/wayland: Fix bug language changed event is always called --- .../ecore_imf/wayland/wayland_imcontext.c | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/src/modules/ecore_imf/wayland/wayland_imcontext.c b/src/modules/ecore_imf/wayland/wayland_imcontext.c index 06fddddadf..7b6517ab7a 100644 --- a/src/modules/ecore_imf/wayland/wayland_imcontext.c +++ b/src/modules/ecore_imf/wayland/wayland_imcontext.c @@ -685,18 +685,22 @@ text_input_language(void *data, if (imcontext->language) { - free(imcontext->language); - if (strcmp(imcontext->language, language) != 0) - changed = EINA_TRUE; + { + changed = EINA_TRUE; + free(imcontext->language); + } } else changed = EINA_TRUE; - imcontext->language = strdup(language); + if (changed) + { + imcontext->language = strdup(language); - if (imcontext->ctx && changed) - ecore_imf_context_input_panel_event_callback_call(imcontext->ctx, ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT, 0); + if (imcontext->ctx) + ecore_imf_context_input_panel_event_callback_call(imcontext->ctx, ECORE_IMF_INPUT_PANEL_LANGUAGE_EVENT, 0); + } } static void