From b1336a27c1a5de3e6f629ff47552deec5fdf172a Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 4 Feb 2016 11:58:03 +0900 Subject: [PATCH] ecore_imf/wayland: notify language changed --- .../ecore_imf/wayland/wayland_imcontext.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) diff --git a/src/modules/ecore_imf/wayland/wayland_imcontext.c b/src/modules/ecore_imf/wayland/wayland_imcontext.c index dd36f0fbb8..d58606eaf4 100644 --- a/src/modules/ecore_imf/wayland/wayland_imcontext.c +++ b/src/modules/ecore_imf/wayland/wayland_imcontext.c @@ -598,11 +598,24 @@ text_input_language(void *data, const char *language) { WaylandIMContext *imcontext = (WaylandIMContext *)data; + Eina_Bool changed = EINA_FALSE; + + if (!imcontext || !language) return; if (imcontext->language) - free(imcontext->language); + { + free(imcontext->language); - imcontext->language = strdup(language ? language : ""); + if (strcmp(imcontext->language, language) != 0) + changed = EINA_TRUE; + } + else + changed = EINA_TRUE; + + 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); } static void