From d15f7446eb56b49ecefe0ef24bd75c1733e66727 Mon Sep 17 00:00:00 2001 From: Wonkeun Oh Date: Tue, 7 Feb 2017 17:16:49 +0900 Subject: [PATCH] Support the update_ise_geometry api to notify the ime geometry to app. Change-Id: I135272bed49696d864aa5d91fa4f0ce6a4b88999 --- ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp | 9 +++++++++ ism/src/isf_info_manager.cpp | 11 ++++++++++- ism/src/isf_panel_agent_base.cpp | 5 +++++ ism/src/isf_panel_agent_base.h | 10 ++++++++++ ism/src/isf_panel_agent_manager.cpp | 8 ++++++++ ism/src/isf_panel_agent_manager.h | 1 + 6 files changed, 43 insertions(+), 1 deletion(-) diff --git a/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp b/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp index 7beaeeb..873791a 100644 --- a/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp +++ b/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp @@ -3055,6 +3055,15 @@ public: wl_input_method_context_hide_input_panel (ic->im_ctx, ic->serial); } + + void + update_ise_geometry (int id, uint32 context_id, uint32 x, uint32 y, uint32 width, uint32 height) { + LOGD ("client id:%d", id); + + if (_focused_ic && _focused_ic->im_ctx) { + wl_input_method_context_update_ise_geometry (_focused_ic->im_ctx, _focused_ic->serial, x, y, width, height); + } + } }; extern "C" { diff --git a/ism/src/isf_info_manager.cpp b/ism/src/isf_info_manager.cpp index 38ca94a..a81a1a8 100644 --- a/ism/src/isf_info_manager.cpp +++ b/ism/src/isf_info_manager.cpp @@ -3105,11 +3105,20 @@ client context helpers: %d, helpers uuid count: %d", void socket_helper_update_ise_geometry (int client, uint32 x, uint32 y, uint32 width, uint32 height) { SCIM_DEBUG_MAIN (4) << __func__ << "\n"; LOGD (""); + int focused_client; + uint32 focused_context; HelperInfoRepository::iterator it = m_helper_active_info_repository.find (client); if (it != m_helper_active_info_repository.end ()) { - if (it->second.uuid == m_current_helper_uuid) + if (it->second.uuid == m_current_helper_uuid) { m_signal_update_ise_geometry (x, y, width, height); + + get_focused_context (focused_client, focused_context); + ClientInfo client_info = socket_get_client_info (focused_client); + if (client_info.type == FRONTEND_CLIENT) { + m_panel_agent_manager.update_ise_geometry (focused_client, focused_context, x, y, width, height); + } + } } } //ISM_TRANS_CMD_GET_KEYBOARD_ISE diff --git a/ism/src/isf_panel_agent_base.cpp b/ism/src/isf_panel_agent_base.cpp index 6605a95..e6743c4 100644 --- a/ism/src/isf_panel_agent_base.cpp +++ b/ism/src/isf_panel_agent_base.cpp @@ -545,6 +545,11 @@ void PanelAgentBase::set_autocapital_type(int client, uint32 context, String uui LOGW("not implemented for %s", m_name.c_str()); } +void PanelAgentBase::update_ise_geometry (int client, uint32 context, uint32 x, uint32 y, uint32 width, uint32 height) +{ + LOGW ("not implemented for %s", m_name.c_str ()); +} + void PanelAgentBase::remote_update_preedit_string (int client, uint32 context, const WideString str, const WideString commit, const AttributeList &attrs, uint32 caret) { LOGW ("not implemented for %s", m_name.c_str ()); diff --git a/ism/src/isf_panel_agent_base.h b/ism/src/isf_panel_agent_base.h index f5ae88e..0cdf061 100644 --- a/ism/src/isf_panel_agent_base.h +++ b/ism/src/isf_panel_agent_base.h @@ -872,12 +872,22 @@ public: virtual void set_autocapital_type (int client, uint32 context, String uuid, int mode); /** + * @brief update_ise_geometry. + * + * @param + * + * @return none. + */ + virtual void update_ise_geometry (int client, uint32 context, uint32 x, uint32 y, uint32 width, uint32 height); + + /** * @brief remote_update_preedit_string. * * @param * * @return none. */ + virtual void remote_update_preedit_string (int client, uint32 context, const WideString str, const WideString commit, const AttributeList &attrs, uint32 caret); /** diff --git a/ism/src/isf_panel_agent_manager.cpp b/ism/src/isf_panel_agent_manager.cpp index e8c8482..5b6a742 100644 --- a/ism/src/isf_panel_agent_manager.cpp +++ b/ism/src/isf_panel_agent_manager.cpp @@ -854,6 +854,14 @@ void PanelAgentManager::set_autocapital_type(int id, uint32 context_id, String u _p->set_autocapital_type (id, context_id, uuid, mode); } +void PanelAgentManager::update_ise_geometry(int id, uint32 context_id, uint32 x, uint32 y, uint32 width, uint32 height) +{ + PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id); + + if (!_p.null ()) + _p->update_ise_geometry (id, context_id, x, y, width, height); +} + void PanelAgentManager::remote_update_preedit_string (int id, uint32 context_id, const WideString str, const WideString commit, const AttributeList &attrs, uint32 caret) { PanelAgentPointer _p = m_impl->get_panel_agent_by_id (id); diff --git a/ism/src/isf_panel_agent_manager.h b/ism/src/isf_panel_agent_manager.h index ba5d055..2a84f91 100644 --- a/ism/src/isf_panel_agent_manager.h +++ b/ism/src/isf_panel_agent_manager.h @@ -351,6 +351,7 @@ public: void process_key_event_done(int client, uint32 context, KeyEvent &key, uint32 ret, uint32 serial); void request_ise_hide(int client, uint32 context); void set_autocapital_type(int id, uint32 context_id, String uuid, int mode); + void update_ise_geometry(int id, uint32 context_id, uint32 x, uint32 y, uint32 width, uint32 height); void remote_update_preedit_string (int target_client, uint32 target_context, const WideString str, const WideString commit,const AttributeList &attrs, uint32 caret); void remote_send_key_event (int target_client, uint32 target_context, const KeyEvent &key); void remote_forward_key_event (int target_client, uint32 target_context, const KeyEvent &key); -- 2.7.4