From 8363846fc972fd5d513eb6cf5ef71bb05b052dfe Mon Sep 17 00:00:00 2001 From: Jihoon Kim Date: Thu, 29 Sep 2016 21:22:44 +0900 Subject: [PATCH] Fix IME does not hide when context is deleted Change-Id: Iaa0035ef5a8cde458c598ebd92debc013692a376 Signed-off-by: Jihoon Kim --- ism/extras/wayland_immodule/wayland_imcontext.c | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/ism/extras/wayland_immodule/wayland_imcontext.c b/ism/extras/wayland_immodule/wayland_imcontext.c index ac0f425..6173740 100644 --- a/ism/extras/wayland_immodule/wayland_imcontext.c +++ b/ism/extras/wayland_immodule/wayland_imcontext.c @@ -68,6 +68,7 @@ static Ecore_IMF_Context *_focused_ctx = NULL; static Ecore_IMF_Context *_show_req_ctx = NULL; static Ecore_IMF_Context *_hide_req_ctx = NULL; static Ecore_IMF_Context *_focus_req_ctx = NULL; +static Ecore_IMF_Context *_input_panel_ctx = NULL; static Eina_Rectangle _keyboard_geometry = {0, 0, 0, 0}; @@ -607,7 +608,12 @@ set_focus(Ecore_IMF_Context *ctx) { LOGD(""); WaylandIMContext *imcontext = (WaylandIMContext *)ecore_imf_context_data_get(ctx); - if (!imcontext || !imcontext->window) return; + if (!imcontext) return; + + if (!imcontext->window) { + LOGW("window is not given\n"); + return; + } Ecore_Wl_Input *input = ecore_wl_window_keyboard_get(imcontext->window); if (!input) { @@ -933,6 +939,7 @@ show_input_panel(Ecore_IMF_Context *ctx) will_hide = EINA_FALSE; _show_req_ctx = ctx; + _input_panel_ctx = ctx; _active_context_canvas = ecore_imf_context_client_canvas_get(ctx); if (imcontext->window) @@ -1712,9 +1719,10 @@ wayland_im_context_del (Ecore_IMF_Context *ctx) if (!imcontext) return; // TIZEN_ONLY(20150708): Support back key - if (_hide_req_ctx == ctx && _hide_timer) { + if (_input_panel_ctx == ctx) { _input_panel_hide(ctx, EINA_TRUE); _input_panel_state = ECORE_IMF_INPUT_PANEL_STATE_HIDE; + _input_panel_ctx = NULL; } if (_focused_ctx == ctx) -- 2.7.4