From bbb71be52ac5d21871c0ff90a147cef44daca623 Mon Sep 17 00:00:00 2001 From: Sungmin Kwak Date: Mon, 2 Sep 2019 10:06:25 +0900 Subject: [PATCH] Initialize the input resource mode after the remote input is finished. Change-Id: I2ef9e6f3fd94f3790c1622b663cbcf54627770d7 --- .../panelagent/wayland/wayland_panel_agent_module.cpp | 13 ++++++++++++- 1 file changed, 12 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 ec501d2..b8dbbc2 100644 --- a/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp +++ b/ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp @@ -2862,6 +2862,14 @@ static uint32_t _keyname_to_keysym (uint32_t keyname, uint32_t *modifiers) } } +static bool _check_remote_input_finished (const uint32 keycode, const bool pressed, const bool fake) +{ + if (pressed == false && fake == true && (keycode == SCIM_KEY_Select || keycode == SCIM_KEY_Cancel)) { + return true; + } + return false; +} + static void send_wl_key_event (WSCContextISF *ic, const KeyEvent &key, bool fake) { SCIM_DEBUG_FRONTEND (1) << __FUNCTION__ << "...\n"; @@ -2884,8 +2892,11 @@ static void send_wl_key_event (WSCContextISF *ic, const KeyEvent &key, bool fake _keyname_to_keysym (key.code, &modifiers); - if (ic) + if (ic) { wsc_context_send_key (ic, key.code, modifiers, time, key.is_key_press ()); + if (_check_remote_input_finished (key.code, key.is_key_press (), fake)) + ic->impl->input_resource = INPUT_RESOURCE_NONE; + } } static void -- 2.7.4