}
Eina_Bool
+e_input_panel_client_find(E_Client *ec)
+{
+ E_Input_Panel_Surface *ips;
+ Eina_List *l;
+
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ec, EINA_FALSE);
+
+ if (!g_input_panel) return EINA_FALSE;
+
+ EINA_LIST_FOREACH(g_input_panel->surfaces, l, ips)
+ {
+ if (!ips->ec) continue;
+ if (ips->ec == ec) return EINA_TRUE;
+ }
+
+ return EINA_FALSE;
+}
+
+Eina_Bool
e_input_panel_init(E_Comp_Data *cdata)
{
if (!cdata) return EINA_FALSE;
#include <input-method-server-protocol.h>
#include "Eeze.h"
+static Eina_Bool _e_text_input_method_context_cb_client_resize(void *data EINA_UNUSED, int type, void *event);
+
typedef struct _E_Text_Input E_Text_Input;
typedef struct _E_Text_Input_Mgr E_Text_Input_Mgr;
typedef struct _E_Input_Method E_Input_Method;
};
static E_Input_Method *g_input_method = NULL;
+static E_Text_Input *g_text_input = NULL;
static Eina_List *shutdown_list = NULL;
static Eina_Bool g_disable_show_panel = EINA_FALSE;
static Eeze_Udev_Watch *eeze_udev_watch_hander = NULL;
static Ecore_Event_Handler *ecore_key_down_handler = NULL;
+static Eina_List *handlers = NULL;
static void
_e_text_input_method_context_keyboard_grab_keyboard_state_update(E_Input_Method_Context *context, uint32_t keycode, Eina_Bool pressed)
EINA_SAFETY_ON_NULL_GOTO(g_input_method->resource, err);
text_input = wl_resource_get_user_data(resource);
+ g_text_input = text_input;
// FIXME: should get input_method object from seat.
input_method = wl_resource_get_user_data(g_input_method->resource);
static void
_e_text_input_cb_deactivate(struct wl_client *client EINA_UNUSED, struct wl_resource *resource, struct wl_resource *seat)
{
+ g_text_input = NULL;
E_Text_Input *text_input = wl_resource_get_user_data(resource);
E_Comp_Data *cdata = wl_resource_get_user_data(seat);
E_Input_Method *input_method = NULL;
g_disable_show_panel = EINA_FALSE;
}
+static Eina_Bool
+_e_text_input_method_context_cb_client_resize(void *data EINA_UNUSED, int type EINA_UNUSED, void *event)
+{
+ E_Event_Client *ev;
+ E_Client *ec;
+ Eina_Bool found;
+
+ ev = (E_Event_Client *)event;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ev, ECORE_CALLBACK_PASS_ON);
+
+ ec = ev->ec;
+ EINA_SAFETY_ON_NULL_RETURN_VAL(ec, ECORE_CALLBACK_PASS_ON);
+
+ found = e_input_panel_client_find(ec);
+ if (!found) return ECORE_CALLBACK_PASS_ON;
+ if ((ec->w < 1) && (ec->h < 1)) return ECORE_CALLBACK_PASS_ON;
+
+ if (g_text_input && g_text_input->resource)
+ wl_text_input_send_input_panel_geometry(g_text_input->resource, ec->x, ec->y, ec->w, ec->h);
+
+ return ECORE_CALLBACK_PASS_ON;
+}
+
EAPI void *
e_modapi_init(E_Module *m)
{
if (!_e_text_input_manager_create(cdata))
goto err;
+ E_LIST_HANDLER_APPEND(handlers, E_EVENT_CLIENT_RESIZE, _e_text_input_method_context_cb_client_resize, NULL);
+
eeze_udev_watch_hander = eeze_udev_watch_add(EEZE_UDEV_TYPE_KEYBOARD,
EEZE_UDEV_EVENT_REMOVE,
_e_mod_eeze_udev_watch_cb,
EAPI int
e_modapi_shutdown(E_Module *m EINA_UNUSED)
{
+ E_FREE_LIST(handlers, ecore_event_handler_del);
+
if (eeze_udev_watch_hander)
{
eeze_udev_watch_del(eeze_udev_watch_hander);