static void _device_output_assign(E_Input_Evdev *edev, E_Input_Seat_Capabilities cap);
static void _pointer_touch_ecore_event_add(void *data);
+static void _input_thread_ecore_event_add(E_Input_Evdev *evdev, int event_type, Eina_Bool touch_event, void *ev, ev_free_func free_func, void *free_func_data);
static Eina_Bool _touch_blocked_by_palm, _touch_up_blocked_by_palm;
Ecore_Event_Mouse_Move *ev;
int x = 0, y = 0, w = 0, h = 0;
const char *device_name = edev->name;
- E_Input_Event_Info *input_event = NULL;
if (!(input = edev->seat->input)) return;
ev->multi.root.x = ev->x;
ev->multi.root.y = ev->y;
- 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_MOVE;
- input_event->free_func = _e_input_event_mouse_move_cb_free;
- input_event->free_func_data = NULL;
-
- ecore_main_loop_thread_safe_call_async(_pointer_touch_ecore_event_add, input_event);
+ _input_thread_ecore_event_add(edev, ECORE_EVENT_MOUSE_MOVE, EINA_FALSE, ev, _e_input_event_mouse_move_cb_free, NULL);
}
void
Ecore_Event_Mouse_Relative_Move *ev;
E_Comp_Config *comp_conf;
const char *device_name = NULL;
- E_Input_Event_Info *input_event = NULL;
if (!(input = edev->seat->input)) return;
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, device_name);
- 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;
-
- ecore_main_loop_thread_safe_call_async(_pointer_touch_ecore_event_add, input_event);
+ _input_thread_ecore_event_add(edev, ECORE_EVENT_MOUSE_RELATIVE_MOVE, EINA_FALSE, ev, _e_input_event_mouse_relative_move_cb_free, NULL);
}
static void
uint32_t button, timestamp;
E_Comp_Config *comp_conf = NULL;
const char *device_name = NULL;
- E_Input_Event_Info *input_event = NULL;
if (!(edev = libinput_device_get_user_data(device)))
{
if (comp_conf && comp_conf->input_log_enable)
ELOGF("Mouse", "Button %s (btn: %d, device: %s)", NULL, state?"Press":"Release", button, ecore_device_name_get(ev->dev));
- 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 = state? ECORE_EVENT_MOUSE_BUTTON_DOWN : ECORE_EVENT_MOUSE_BUTTON_UP;
- input_event->free_func = _e_input_event_mouse_button_cb_free;
- input_event->free_func_data = NULL;
-
- ecore_main_loop_thread_safe_call_async(_pointer_touch_ecore_event_add, input_event);
+ _input_thread_ecore_event_add(edev, state? ECORE_EVENT_MOUSE_BUTTON_DOWN : ECORE_EVENT_MOUSE_BUTTON_UP, EINA_FALSE, ev, _e_input_event_mouse_button_cb_free, NULL);
}
#if !LIBINPUT_HAVE_SCROLL_VALUE_V120
ELOGF("Mouse", "Wheel (direction: %d, value: %d)", NULL, ev->direction, ev->z);
}
- input_event = E_NEW(E_Input_Event_Info, 1);
- input_event->touch_event = EINA_FALSE;
- input_event->evdev = evdev;
- input_event->ev = ev;
- input_event->event_type = ECORE_EVENT_MOUSE_WHEEL;
- input_event->free_func = _e_input_event_mouse_wheel_cb_free;
- input_event->free_func_data = NULL;
-
- ecore_main_loop_thread_safe_call_async(_pointer_touch_ecore_event_add, input_event);
+ _input_thread_ecore_event_add(edev, ECORE_EVENT_MOUSE_WHEEL, EINA_FALSE, ev, _e_input_event_mouse_wheel_cb_free, NULL);
}
#endif
Ecore_Device *detent_data = NULL;
E_Comp_Config *comp_conf = NULL;
int direction = 0, z = 0;
- E_Input_Event_Info *input_event = NULL;
if (!(edev = libinput_device_get_user_data(device)))
{
ELOGF("Mouse", "Wheel (direction: %d, value: %d)", NULL, ev->direction, ev->z);
}
- 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_WHEEL;
- input_event->free_func = _e_input_event_mouse_wheel_cb_free;
- input_event->free_func_data = NULL;
-
- ecore_main_loop_thread_safe_call_async(_pointer_touch_ecore_event_add, input_event);
+ _input_thread_ecore_event_add(edev, ECORE_EVENT_MOUSE_WHEEL, EINA_FALSE, ev, _e_input_event_mouse_wheel_cb_free, NULL);
}
#endif
}
static void
-_input_thread_ecore_event_add(E_Input_Evdev *evdev, int event_type, void *ev, ev_free_func free_func, void *free_func_data)
+_input_thread_ecore_event_add(E_Input_Evdev *evdev, int event_type, Eina_Bool touch_event, void *ev, ev_free_func free_func, void *free_func_data)
{
E_Input_Backend *input;
E_Input_Event_Info *input_event = NULL;
return;
input_event = E_NEW(E_Input_Event_Info, 1);
- input_event->touch_event = EINA_TRUE;
+ EINA_SAFETY_ON_NULL_GOTO(input_event, err);
+
+ input_event->touch_event = touch_event;
input_event->evdev = evdev;
input_event->event_type = event_type;
input_event->ev = ev;
input_event->free_func_data = free_func_data;
ecore_main_loop_thread_safe_call_async(_pointer_touch_ecore_event_add, input_event);
+
+ return;
+
+err:
+ free_func((void *)free_func_data, (void *)ev);
}
static void
ELOGF("Touch", "Failed to pend event (%s). Call ecore_event_add imediately.", NULL,
state == ECORE_EVENT_MOUSE_BUTTON_DOWN ? "DOWN" : "UP");
- _input_thread_ecore_event_add(edev, state, ev, _e_input_event_mouse_button_cb_free, NULL);
+ _input_thread_ecore_event_add(edev, state, EINA_TRUE, ev, _e_input_event_mouse_button_cb_free, NULL);
}
}
if (!_touch_event_pending_add(edev, ECORE_EVENT_MOUSE_MOVE, ev))
{
ELOGF("Touch", "Failed to pend event (MOVE). Call ecore_event_add immediately.", NULL);
- _input_thread_ecore_event_add(edev, ECORE_EVENT_MOUSE_MOVE, ev, _e_input_event_mouse_move_cb_free, NULL);
+ _input_thread_ecore_event_add(edev, ECORE_EVENT_MOUSE_MOVE, EINA_TRUE, ev, _e_input_event_mouse_move_cb_free, NULL);
}
}
if (!_touch_event_pending_add(edev, ECORE_EVENT_MOUSE_BUTTON_CANCEL, ev))
{
ELOGF("Touch", "Failed to pend event (CANCEL). Call ecore_event_add imediately.", NULL);
- _input_thread_ecore_event_add(edev, ECORE_EVENT_MOUSE_BUTTON_CANCEL, ev, _e_input_event_mouse_button_cb_free, NULL);
+ _input_thread_ecore_event_add(edev, ECORE_EVENT_MOUSE_BUTTON_CANCEL, EINA_TRUE, ev, _e_input_event_mouse_button_cb_free, NULL);
}
}
Ecore_Axis *axis;
E_Comp_Config *comp_conf;
int touch_value;
- E_Input_Event_Info *input_event = NULL;
if (libinput_event_touch_aux_data_get_type(event) != LIBINPUT_TOUCH_AUX_DATA_TYPE_PALM &&
libinput_event_touch_aux_data_get_value(event) > 0)
}
}
- input_event = E_NEW(E_Input_Event_Info, 1);
- input_event->touch_event = EINA_TRUE;
- input_event->evdev = edev;
- input_event->ev = ev;
- input_event->event_type = ECORE_EVENT_AXIS_UPDATE;
- input_event->free_func = _e_input_aux_data_event_free;
- input_event->free_func_data = NULL;
-
- ecore_main_loop_thread_safe_call_async(_pointer_touch_ecore_event_add, input_event);
+ _input_thread_ecore_event_add(edev, ECORE_EVENT_AXIS_UPDATE, EINA_TRUE, ev, _e_input_aux_data_event_free, NULL);
}
E_Input_Evdev *