}
static void
-_e_text_input_cb_destroy(struct wl_client *client EINA_UNUSED, struct wl_resource *resource)
+_e_text_input_cb_destroy(struct wl_client *client, struct wl_resource *resource)
{
+ LOGD("");
+ E_Text_Input *text_input = wl_resource_get_user_data(resource);
+ E_Input_Method *input_method = NULL;
+ Eina_Bool _context_created = EINA_FALSE;
+
+ if (!text_input)
+ {
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input For Resource");
+ return;
+ }
+
+ if (g_input_method && g_input_method->resource)
+ input_method = wl_resource_get_user_data(g_input_method->resource);
+
+ if (!input_method)
+ {
+ WTI_WARNING(resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Input Method For Seat");
+ return;
+ }
+
+ if ((!input_method->context) || (!input_method->context->resource))
+ _context_created = _e_text_input_method_create_context(client, input_method, text_input, EINA_FALSE);
+
+ if (input_method->resource && input_method->context && input_method->context->resource)
+ wl_input_method_send_destroy(input_method->resource, input_method->context->resource);
+
+ if (_context_created)
+ _e_text_input_deactivate(text_input, input_method, EINA_FALSE);
+
wl_resource_destroy(resource);
}