Initialize the input resource mode after the remote input is finished. 73/213173/1
authorSungmin Kwak <sungmin.kwak@samsung.com>
Mon, 2 Sep 2019 01:06:25 +0000 (10:06 +0900)
committerSungmin Kwak <sungmin.kwak@samsung.com>
Mon, 2 Sep 2019 07:48:03 +0000 (16:48 +0900)
Change-Id: I2ef9e6f3fd94f3790c1622b663cbcf54627770d7

ism/modules/panelagent/wayland/wayland_panel_agent_module.cpp

index ec501d2..b8dbbc2 100644 (file)
@@ -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