From: Inhong Han Date: Wed, 12 Feb 2025 00:40:01 +0000 (+0900) Subject: Support the Input Delegator self-termination X-Git-Tag: accepted/tizen/unified/20250214.120501~1 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=0aef33be5f99feaedcd9d9cd28ebe1e832506b72;p=platform%2Fcore%2Fuifw%2Fe-mod-tizen-wl-textinput.git Support the Input Delegator self-termination Change-Id: I15c054f7a2a6eefd97b1342f3ae86f71969e9d67 --- diff --git a/src/e_mod_main.c b/src/e_mod_main.c index 47b8094..458a81c 100644 --- a/src/e_mod_main.c +++ b/src/e_mod_main.c @@ -145,6 +145,8 @@ 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_fullscreen_mode = EINA_FALSE; +static E_Text_Input *g_fullscreen_text_input = NULL; +static uint32_t g_input_hint = 0; static Ecore_Idler *g_vconf_idler = NULL; /* The candidate's show state that was requested by the application or IME */ @@ -1429,6 +1431,9 @@ _e_text_input_cb_input_panel_show(struct wl_client *client, struct wl_resource * angle += e_client_e_state_rot_angle_current_get(client_surface_ec); } + if (g_input_hint & WL_TEXT_INPUT_CONTENT_HINT_FULLSCREEN_MODE) + g_fullscreen_text_input = text_input; + zwp_input_method_v1_send_show_input_panel(input_method->resource, input_method->context->resource, angle); /* we need to force update in order to release buffer @@ -1508,6 +1513,8 @@ _e_text_input_cb_content_type_set(struct wl_client *client EINA_UNUSED, struct w else g_fullscreen_mode = EINA_FALSE; + g_input_hint = hint; + EINA_LIST_FOREACH(text_input->input_methods, l, input_method) { if (!input_method || !input_method->context) continue; @@ -1933,6 +1940,33 @@ _e_text_input_cb_input_panel_position_align_set(struct wl_client *client EINA_UN } } +static void +_e_text_input_terminate_fullscreen_input_panel(struct wl_client *client, struct wl_resource *resource) +{ + E_Text_Input *text_input = wl_resource_get_user_data(resource); + E_Input_Method *input_method = NULL; + Eina_Bool _context_created = EINA_FALSE; + + CHECK_TEXT_INPUT(resource, text_input); + + if (g_input_method && g_input_method->resource) + input_method = wl_resource_get_user_data(g_input_method->resource); + + EINA_SAFETY_ON_NULL_RETURN(input_method); + + 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->context && input_method->context->resource) + { + LOGI("Request to terminate the fullscreen input panel"); + zwp_input_method_context_v1_send_client_destroyed(input_method->context->resource); + } + + if (_context_created) + _e_text_input_deactivate(text_input, input_method, EINA_FALSE); +} + static void _e_text_input_cb_resource_destroy(struct wl_resource *resource) { @@ -1953,6 +1987,12 @@ _e_text_input_cb_resource_destroy(struct wl_resource *resource) g_show_text_input = NULL; } + if (g_fullscreen_text_input == text_input) + { + _e_text_input_terminate_fullscreen_input_panel(g_client, resource); + g_fullscreen_text_input = NULL; + } + if (g_text_input == text_input) { g_text_input = NULL;