From 32122f0a84ab721e7d74efd8199cba99d3f7fbc0 Mon Sep 17 00:00:00 2001 From: Ji-hoon Lee Date: Thu, 13 Jul 2017 16:48:05 +0900 Subject: [PATCH] Send candidate show/hide status update to wayland module Change-Id: I8a4de6017a95ba3faf9e2c39fea591522967ec05 --- ism/extras/efl_panel/isf_panel_efl.cpp | 2 ++ .../wayland/wayland_panel_agent_module.cpp | 20 ++++++++++++++++++ ism/src/isf_info_manager.cpp | 24 ++++++++++++++++++---- 3 files changed, 42 insertions(+), 4 deletions(-) diff --git a/ism/extras/efl_panel/isf_panel_efl.cpp b/ism/extras/efl_panel/isf_panel_efl.cpp index 27c8c37..daf0534 100644 --- a/ism/extras/efl_panel/isf_panel_efl.cpp +++ b/ism/extras/efl_panel/isf_panel_efl.cpp @@ -1859,6 +1859,8 @@ static bool set_active_ise (const String &uuid, bool launch_ise) } _info_manager->set_current_toolbar_mode (_ime_info[i].mode); if (ise_changed) { + /* From Tizen 4.0 all the ISEs need to handle H/W keyboard events */ + _ime_info[i].options |= ISM_HELPER_PROCESS_KEYBOARD_KEYEVENT; _info_manager->set_current_helper_option (_ime_info[i].options); _info_manager->set_current_ise_name (_ime_info[i].label); _ise_width = 0; diff --git a/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp b/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp index ca2b468..519654c 100644 --- a/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp +++ b/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp @@ -3367,6 +3367,26 @@ public: wl_input_method_context_update_ise_geometry (_focused_ic->im_ctx, _focused_ic->serial, x, y, width, height); } } + + void helper_candidate_show(int id, uint32 context_id, const String& uuid) + { + WSCContextISF* ic = find_ic(context_id); + if (!ic) return; + + if (ic->im_ctx) { + wl_input_method_context_update_candidate_state(ic->im_ctx, 1); + } + } + + void helper_candidate_hide(int id, uint32 context_id, const String& uuid) + { + WSCContextISF* ic = find_ic(context_id); + if (!ic) return; + + if (ic->im_ctx) { + wl_input_method_context_update_candidate_state(ic->im_ctx, 0); + } + } }; extern "C" { diff --git a/ism/src/isf_info_manager.cpp b/ism/src/isf_info_manager.cpp index 332e674..6f26f67 100644 --- a/ism/src/isf_info_manager.cpp +++ b/ism/src/isf_info_manager.cpp @@ -627,6 +627,8 @@ public: bool helper_candidate_show (void) { SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n"; LOGD (""); + bool ret = false; + int client; uint32 context; get_focused_context (client, context); @@ -637,16 +639,24 @@ public: if (it != m_helper_client_index.end ()) { uint32 ctx = get_helper_ic (client, context); m_panel_agent_manager.helper_candidate_show (it->second.id, ctx, m_current_helper_uuid); - return true; + ret = true; } } - return false; + /* Inform wayland module that we are showing candidate window */ + int focused_client; + uint32 focused_context; + String focused_uuid = get_focused_context(focused_client, focused_context); + m_panel_agent_manager.helper_candidate_show(focused_client, focused_context, focused_uuid); + + return ret; } bool helper_candidate_hide (void) { SCIM_DEBUG_MAIN (4) << __FUNCTION__ << "...\n"; LOGD (""); + bool ret = false; + int client; uint32 context; get_focused_context (client, context); @@ -657,11 +667,17 @@ public: if (it != m_helper_client_index.end ()) { uint32 ctx = get_helper_ic (client, context); m_panel_agent_manager.helper_candidate_hide (it->second.id, ctx, m_current_helper_uuid); - return true; + ret = true; } } - return false; + /* Inform wayland module that we are hiding candidate window */ + int focused_client; + uint32 focused_context; + String focused_uuid = get_focused_context(focused_client, focused_context); + m_panel_agent_manager.helper_candidate_hide(focused_client, focused_context, focused_uuid); + + return ret; } bool candidate_more_window_show (void) { -- 2.7.4