Modified not to show IME automatically when the state of the input_panel_enabled... 48/239748/1
authorInHong Han <inhong1.han@samsung.com>
Wed, 29 Jul 2020 10:49:11 +0000 (19:49 +0900)
committerInHong Han <inhong1.han@samsung.com>
Wed, 29 Jul 2020 10:49:11 +0000 (19:49 +0900)
Change-Id: I62463596bc3a25315d13320ba0136c7e8445becb

src/e_mod_main.c

index 44647a2..e265681 100644 (file)
@@ -138,6 +138,7 @@ static E_Client *client_surface_ec = NULL;
 static E_Text_Input *g_show_text_input = NULL;
 static struct wl_client *g_show_client = NULL;
 static Eina_Bool g_updated_geometry = EINA_FALSE;
+static Eina_Bool g_input_panel_enabled = EINA_TRUE;
 
 /* The candidate's show state that was requested by the application or IME */
 static Eina_Bool g_show_state_candidate = EINA_FALSE;
@@ -324,7 +325,7 @@ _keyboard_mode_changed_cb(keynode_t *key, void* data)
 
    if (val == false)
      {
-        if (!g_disable_show_panel && g_text_input && g_text_input->resource && g_client && g_input_panel_state == E_INPUT_PANEL_STATE_DID_HIDE)
+        if (!g_disable_show_panel && g_text_input && g_text_input->resource && g_client && g_input_panel_state == E_INPUT_PANEL_STATE_DID_HIDE && g_input_panel_enabled)
           _e_text_input_cb_input_panel_show(g_client, g_text_input->resource);
 
 #ifdef SUPPORT_CANDIDATE_ONEWINDOW
@@ -1964,6 +1965,22 @@ _e_text_input_cb_prediction_hint_data_set(struct wl_client *client EINA_UNUSED,
 }
 
 static void
+_e_text_input_cb_input_panel_enabled_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, uint32_t enabled)
+{
+   E_Text_Input *text_input = wl_resource_get_user_data(resource);
+
+   if (!text_input)
+     {
+        WTI_WARNING(resource,
+                    WL_DISPLAY_ERROR_INVALID_OBJECT,
+                    "No Text Input For Resource");
+        return;
+     }
+
+   g_input_panel_enabled = enabled;
+}
+
+static void
 _e_text_input_cb_mime_type_accept_set(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, const char *mime_type)
 {
    E_Text_Input *text_input = wl_resource_get_user_data(resource);
@@ -2128,7 +2145,8 @@ static const struct wl_text_input_interface _e_text_input_implementation = {
      _e_text_input_cb_mime_type_accept_set,
      _e_text_input_cb_input_panel_position_set,
      _e_text_input_cb_finalize_content,
-     _e_text_input_cb_prediction_hint_data_set
+     _e_text_input_cb_prediction_hint_data_set,
+     _e_text_input_cb_input_panel_enabled_set
 };
 
 static void