{
E_Input_Backend *input;
Ecore_Event_Mouse_Relative_Move *ev;
- Ecore_Device *ecore_dev = NULL, *data, *detent_data = NULL;
- Eina_List *l;
E_Comp_Config *comp_conf;
const char *device_name = NULL;
+ E_Input_Event_Info *input_event = NULL;
if (!(input = edev->seat->input)) return;
device_name = edev->name;
- ecore_thread_main_loop_begin();
-
- if (edev->ecore_dev) ecore_dev = edev->ecore_dev;
- else if (edev->ecore_dev_list && eina_list_count(edev->ecore_dev_list) > 0)
- {
- EINA_LIST_FOREACH(edev->ecore_dev_list, l, data)
- {
- if (ecore_device_class_get(data) == ECORE_DEVICE_CLASS_MOUSE)
- {
- ecore_dev = data;
- break;
- }
- else if (ecore_device_class_get(data) == ECORE_DEVICE_CLASS_NONE)
- {
- detent_data = data;
- }
- }
- if (!ecore_dev && e_devicemgr_detent_is_detent(device_name))
- {
- ecore_dev = detent_data;
- }
- }
- else
- {
- edev->ecore_dev = e_input_evdev_get_ecore_device(edev->path, ECORE_DEVICE_CLASS_MOUSE);
- ecore_dev = edev->ecore_dev;
- }
-
- if (!ecore_dev)
- {
- ERR("Failed to get source ecore device from event !\n");
- goto end;
- }
- else if ((detent_data == ecore_dev) || e_devicemgr_detent_is_detent(ecore_device_name_get(ecore_dev)))
- {
- /* Do not process detent device's move events. */
- goto end;
- }
-
if (!(ev = calloc(1, sizeof(Ecore_Event_Mouse_Relative_Move)))) return;
ev->window = (Ecore_Window)input->dev->window;
ev->dx_unaccel = (int)dx[1];
ev->dy_unaccel = (int)dy[1];
- ev->dev = ecore_device_ref(ecore_dev);
-
comp_conf = e_comp_config_get();
if (comp_conf && comp_conf->input_log_enable)
- ELOGF("Mouse", "Relative Move (time: %d, dx: %d, dy: %d, unaccel(%d, %d) device: %s)", NULL, ev->timestamp, ev->dx, ev->dy, ev->dx_unaccel, ev->dy_unaccel, ecore_device_name_get(ev->dev));
+ ELOGF("Mouse", "Relative Move (time: %d, dx: %d, dy: %d, unaccel(%d, %d) device: %s)", NULL, ev->timestamp, ev->dx, ev->dy, ev->dx_unaccel, ev->dy_unaccel, device_name);
- ecore_event_add(ECORE_EVENT_MOUSE_RELATIVE_MOVE, ev, _e_input_event_mouse_relative_move_cb_free, NULL);
+ input_event = E_NEW(E_Input_Event_Info, 1);
+ input_event->touch_event = EINA_FALSE;
+ input_event->evdev = edev;
+ input_event->ev = ev;
+ input_event->event_type = ECORE_EVENT_MOUSE_RELATIVE_MOVE;
+ input_event->free_func = _e_input_event_mouse_relative_move_cb_free;
+ input_event->free_func_data = NULL;
-end:
- ecore_thread_main_loop_end();
+ ecore_main_loop_thread_safe_call_async(_pointer_touch_ecore_event_add, input_event);
}
static void
Ecore_Event_Mouse_Move *ev = input_info->ev;
ev->dev = ecore_device_ref(ecore_dev);
}
+ else if (input_info->event_type == ECORE_EVENT_MOUSE_RELATIVE_MOVE)
+ {
+ Ecore_Event_Mouse_Relative_Move *ev = input_info->ev;
+ ev->dev = ecore_device_ref(ecore_dev);
+ }
else if (input_info->event_type == ECORE_EVENT_MOUSE_WHEEL)
{
Ecore_Event_Mouse_Wheel *ev = input_info->ev;