static enum _E_Input_Panel_State g_input_panel_state = E_INPUT_PANEL_STATE_DID_HIDE;
static E_Client *client_surface_ec = NULL;
static E_Text_Input *g_show_text_input = NULL;
+static E_Text_Input *g_old_text_input = NULL;
static Eina_List *hooks_ec = NULL;
return;
if (old)
- _e_text_input_deactivate(old, input_method, EINA_TRUE);
+ {
+ _e_text_input_deactivate(old, input_method, EINA_TRUE);
+ if (g_input_panel_state == E_INPUT_PANEL_STATE_DID_SHOW || g_input_panel_state == E_INPUT_PANEL_STATE_WILL_SHOW)
+ {
+ g_old_text_input = old;
+ }
+ }
if (!_e_text_input_method_create_context(client, input_method, text_input, EINA_TRUE))
return;
g_client = NULL;
}
+ if (text_input == g_old_text_input)
+ {
+ g_old_text_input = NULL;
+ }
+
/* FIXME: should get input_method object from seat. */
if (g_input_method && g_input_method->resource)
input_method = wl_resource_get_user_data(g_input_method->resource);
_e_text_input_cb_input_panel_hide(struct wl_client *client, struct wl_resource *resource)
{
E_Text_Input *text_input = wl_resource_get_user_data(resource);
+ Eina_Bool hide_allowed = EINA_FALSE;
+
+ if (!g_text_input || (text_input && g_show_text_input == text_input))
+ hide_allowed = EINA_TRUE;
+
+ if (g_old_text_input && text_input == g_old_text_input && g_client == client)
+ hide_allowed = EINA_TRUE;
- if (!g_text_input || (text_input && g_show_text_input == text_input)) {
- _input_panel_hide(client, resource, EINA_FALSE);
- g_show_text_input = NULL;
- }
+ if (hide_allowed)
+ {
+ _input_panel_hide(client, resource, EINA_FALSE);
+ g_show_text_input = NULL;
+ g_old_text_input = NULL;
+ }
}
static void