static Eina_List *shutdown_list = NULL;
static Eina_Bool g_disable_show_panel = EINA_FALSE;
static Eeze_Udev_Watch *eeze_udev_watch_handler = NULL;
+static Ecore_Event_Handler *ecore_key_down_handler = NULL;
static E_Input_Event_Filter *e_input_key_down_filter = NULL;
static Eina_List *handlers = NULL;
static uint32_t g_text_input_count = 1;
if (context->kbd.state) xkb_state_unref(context->kbd.state);
context->kbd.keymap = xkb_map_ref(e_comp_wl->xkb.keymap);
context->kbd.state = xkb_state_new(e_comp_wl->xkb.keymap);
-
- E_Input_Event_Source *input_event_source = e_input_event_source_get();
- if (input_event_source)
+ if (!e_input_thread_mode_get())
+ {
+ E_LIST_HANDLER_APPEND(context->kbd.handlers, ECORE_EVENT_KEY_DOWN,
+ _e_text_input_method_context_ecore_cb_key_down,
+ context);
+ E_LIST_HANDLER_APPEND(context->kbd.handlers, ECORE_EVENT_KEY_UP,
+ _e_text_input_method_context_ecore_cb_key_up,
+ context);
+ }
+ else
{
- _key_down_handler = e_input_event_handler_add(input_event_source, ECORE_EVENT_KEY_DOWN, _e_text_input_method_context_ecore_cb_key_down, context);
- _key_up_handler = e_input_event_handler_add(input_event_source, ECORE_EVENT_KEY_UP, _e_text_input_method_context_ecore_cb_key_up, context);
+ E_Input_Event_Source *input_event_source = e_input_event_source_get();
+ if (input_event_source)
+ {
+ _key_down_handler = e_input_event_handler_add(input_event_source, ECORE_EVENT_KEY_DOWN, _e_text_input_method_context_ecore_cb_key_down, context);
+ _key_up_handler = e_input_event_handler_add(input_event_source, ECORE_EVENT_KEY_UP, _e_text_input_method_context_ecore_cb_key_up, context);
+ }
}
e_comp_grab_input(0, 1);
{
E_FREE_LIST(context->kbd.handlers, ecore_event_handler_del);
- E_Input_Event_Source *input_event_source = e_input_event_source_get();
- if (input_event_source)
+ if (e_input_thread_mode_get())
{
- if (_key_down_handler)
- e_input_event_handler_del(input_event_source, _key_down_handler);
+ E_Input_Event_Source *input_event_source = e_input_event_source_get();
+ if (input_event_source)
+ {
+ if (_key_down_handler)
+ e_input_event_handler_del(input_event_source, _key_down_handler);
- if (_key_up_handler)
- e_input_event_handler_del(input_event_source, _key_up_handler);
+ if (_key_up_handler)
+ e_input_event_handler_del(input_event_source, _key_up_handler);
- _key_down_handler = NULL;
- _key_up_handler = NULL;
+ _key_down_handler = NULL;
+ _key_up_handler = NULL;
+ }
}
e_comp_ungrab_input(0, 1);
e->same_screen = 1;
e->keycode = keycode;
- E_Input_Event_Source *input_event_source = e_input_event_source_get();
- if (input_event_source)
- e_input_event_add(input_event_source, state ? ECORE_EVENT_KEY_DOWN : ECORE_EVENT_KEY_UP, e, _e_keyevent_free, NULL);
+ if (!e_input_thread_mode_get())
+ {
+ ecore_event_add(state ? ECORE_EVENT_KEY_DOWN : ECORE_EVENT_KEY_UP, e, _e_keyevent_free, NULL);
+ }
+ else
+ {
+ E_Input_Event_Source *input_event_source = e_input_event_source_get();
+ if (input_event_source)
+ e_input_event_add(input_event_source, state ? ECORE_EVENT_KEY_DOWN : ECORE_EVENT_KEY_UP, e, _e_keyevent_free, NULL);
+ }
}
static void
free(context);
}
-static gboolean
+static Eina_Bool
_e_mod_ecore_key_down_cb(void *data, int type, void *event)
{
Ecore_Event_Key *ev = (Ecore_Event_Key *)event;
if (g_disable_show_panel == EINA_TRUE)
return ECORE_CALLBACK_PASS_ON;
- E_Device *dev = (E_Device *)ev->dev;
+ if (e_input_thread_mode_get())
+ {
+ E_Device *dev = (E_Device *)ev->dev;
- /* process remote controller key exceptionally */
- if (e_device_class_get(dev) == ECORE_DEVICE_CLASS_KEYBOARD &&
- e_device_subclass_get(dev) == ECORE_DEVICE_SUBCLASS_REMOCON)
- return ECORE_CALLBACK_PASS_ON;
+ /* process remote controller key exceptionally */
+ if (e_device_class_get(dev) == ECORE_DEVICE_CLASS_KEYBOARD &&
+ e_device_subclass_get(dev) == ECORE_DEVICE_SUBCLASS_REMOCON)
+ return ECORE_CALLBACK_PASS_ON;
+ }
+ else
+ {
+ Ecore_Device *dev = ev->dev;
+
+ /* process remote controller key exceptionally */
+ if (ecore_device_class_get(dev) == ECORE_DEVICE_CLASS_KEYBOARD &&
+ ecore_device_subclass_get(dev) == ECORE_DEVICE_SUBCLASS_REMOCON)
+ return ECORE_CALLBACK_PASS_ON;
+ }
/* process up/down/left/right and some keys exceptionally */
/* KP_XXX key is used as arrow key and number key in keypad, so ev->string is used for checking whether KP_XXX key is number key or not */
}
}
- if (e_input_key_down_filter)
+ if (e_input_thread_mode_get())
{
- E_Input_Event_Source *input_event_source = e_input_event_source_get();
- e_input_event_filter_del(input_event_source, e_input_key_down_filter);
- e_input_key_down_filter = NULL;
+ if (e_input_key_down_filter)
+ {
+ E_Input_Event_Source *input_event_source = e_input_event_source_get();
+ e_input_event_filter_del(input_event_source, e_input_key_down_filter);
+ e_input_key_down_filter = NULL;
+ }
+ }
+ else
+ {
+ if (ecore_key_down_handler)
+ {
+ ecore_event_handler_del(ecore_key_down_handler);
+ ecore_key_down_handler = NULL;
+ }
}
LOGI("Resetting input_method->input : %p, text_input : %p, %p %p",
if (input_method->resource)
{
- E_Input_Event_Source *input_event_source = e_input_event_source_get();
- if (!e_input_key_down_filter)
- e_input_key_down_filter = e_input_event_filter_add(input_event_source, ECORE_EVENT_KEY_DOWN, _e_mod_ecore_key_down_cb, NULL);
+ if (!e_input_thread_mode_get())
+ {
+ if (!ecore_key_down_handler)
+ ecore_key_down_handler = ecore_event_handler_prepend(ECORE_EVENT_KEY_DOWN,
+ _e_mod_ecore_key_down_cb,
+ NULL);
+ }
+ else
+ {
+ E_Input_Event_Source *input_event_source = e_input_event_source_get();
+ if (!e_input_key_down_filter)
+ e_input_key_down_filter = e_input_event_filter_add(input_event_source, ECORE_EVENT_KEY_DOWN, _e_mod_ecore_key_down_cb, NULL);
+ }
context = create_input_method_context(client, input_method);
EINA_SAFETY_ON_NULL_GOTO(context, err);