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;
/* The candidate's show state that was requested by the application or IME */
static Eina_Bool g_show_state_candidate = EINA_FALSE;
}
if ((context->input) && (context->input->resource))
- _e_text_input_send_input_panel_geometry(context->input->resource, x, y, width, height);
+ {
+ _e_text_input_send_input_panel_geometry(context->input->resource, x, y, width, height);
+ g_updated_geometry = EINA_TRUE;
+ }
}
static const struct wl_input_method_context_interface _e_text_input_method_context_implementation = {
g_input_panel_state = E_INPUT_PANEL_STATE_WILL_SHOW;
g_show_text_input = text_input;
- if (text_input->resource)
- {
- int x = 0, y = 0, w = 0, h = 0;
- if (e_input_panel_client_geometry_get(NULL, &x, &y, &w, &h))
- _e_text_input_send_input_panel_geometry(text_input->resource, x, y, w, h);
-
- wl_text_input_send_input_panel_state(text_input->resource, WL_TEXT_INPUT_INPUT_PANEL_STATE_SHOW);
- }
+ g_updated_geometry = EINA_FALSE;
e_input_panel_transient_for_set(client_surface_ec);
}
}
}
+void
+e_text_input_update_input_panel_state(Eina_Bool state)
+{
+ if (!g_text_input || !g_text_input->resource) return;
+
+ E_Text_Input *text_input = wl_resource_get_user_data(g_text_input->resource);
+
+ if (!text_input)
+ {
+ WTI_WARNING(g_text_input->resource,
+ WL_DISPLAY_ERROR_INVALID_OBJECT,
+ "No Text Input For Resource");
+ return;
+ }
+
+ if (text_input->resource)
+ {
+ if (!g_updated_geometry)
+ {
+ int x = 0, y = 0, w = 0, h = 0;
+ if (e_input_panel_client_geometry_get(NULL, &x, &y, &w, &h))
+ _e_text_input_send_input_panel_geometry(text_input->resource, x, y, w, h);
+ g_updated_geometry = EINA_TRUE;
+ }
+ uint32_t input_panel_state = WL_TEXT_INPUT_INPUT_PANEL_STATE_HIDE;
+ if (state) input_panel_state = WL_TEXT_INPUT_INPUT_PANEL_STATE_SHOW;
+ wl_text_input_send_input_panel_state(text_input->resource, input_panel_state);
+ }
+}
+
E_API void *
e_modapi_init(E_Module *m)
{