void *event;
};
+typedef struct _E_Input_Event
+{
+ E_Input_Evdev *evdev;
+ int event_type;
+ void *ev;
+ ev_free_func free_func;
+ void *free_func_data;
+} E_Input_Event_Info;
+
static void _device_modifiers_update(E_Input_Evdev *evdev);
static void _device_configured_size_get(E_Input_Evdev *evdev, int *x, int *y, int *w, int *h);
static void _device_output_assign(E_Input_Evdev *evdev, E_Input_Seat_Capabilities cap);
return EINA_TRUE;
}
+static void
+_touch_ecore_event_add(void *data)
+{
+ E_Input_Event_Info *input_info = data;
+ Ecore_Device *ecore_dev = NULL;
+
+ ecore_dev = _main_thread_mode_touch_device_get(input_info->evdev);
+
+ if (input_info->event_type == ECORE_EVENT_MOUSE_MOVE)
+ {
+ Ecore_Event_Mouse_Move *ev = input_info->ev;
+ ev->dev = ecore_device_ref(ecore_dev);
+ }
+ else if (input_info->event_type == ECORE_EVENT_MOUSE_BUTTON_DOWN ||
+ input_info->event_type == ECORE_EVENT_MOUSE_BUTTON_UP ||
+ input_info->event_type == ECORE_EVENT_MOUSE_BUTTON_CANCEL)
+ {
+ Ecore_Event_Mouse_Button *ev = input_info->ev;
+ ev->dev = ecore_device_ref(ecore_dev);
+ }
+
+ ecore_event_add(input_info->event_type, input_info->ev, input_info->free_func, input_info->free_func_data);
+
+ free(input_info);
+}
+
static void
_input_event_add(E_Input_Evdev *evdev, int event_type, void *ev, ev_free_func free_func, void *free_func_data)
{
E_Input_Backend *input;
+ E_Input_Event_Info *input_event = NULL;
+
if (!(input = evdev->seat->input))
return;
e_input_event_add(input->event_source, event_type, ev, free_func, free_func_data);
else
{
- ecore_thread_main_loop_begin();
- ecore_event_add(event_type, ev, free_func, free_func_data);
- ecore_thread_main_loop_end();
+ input_event = E_NEW(E_Input_Event_Info, 1);
+ input_event->evdev = evdev;
+ input_event->event_type = event_type;
+ input_event->ev = ev;
+ input_event->free_func = free_func;
+ input_event->free_func_data = free_func_data;
+
+ ecore_main_loop_thread_safe_call_async(_touch_ecore_event_add, input_event);
}
}
E_Input_Backend *input;
Ecore_Event_Mouse_Button *ev;
uint32_t timestamp, button = 0;
- Ecore_Device *ecore_dev = NULL;
E_Device *e_dev = NULL;
double radius_x = 1;
double radius_y = 1;
e_dev = _input_thread_mode_touch_device_get(evdev);
ev->dev = (Eo *)g_object_ref(e_dev);
}
- else
- {
- ecore_thread_main_loop_begin();
- ecore_dev = _main_thread_mode_touch_device_get(evdev);
- ev->dev = ecore_device_ref(ecore_dev);
- ecore_thread_main_loop_end();
- }
if (!_touch_event_pending_add(evdev, state, ev))
{
{
E_Input_Backend *input;
Ecore_Event_Mouse_Move *ev;
- Ecore_Device *ecore_dev = NULL;
E_Device *e_dev = NULL;
uint32_t timestamp = 0;
double radius_x = 1.0, radius_y = 1.0, pressure = 1.0, angle = 0.0;
e_dev = _input_thread_mode_touch_device_get(evdev);
ev->dev = (Eo *)g_object_ref(e_dev);
}
- else
- {
- ecore_thread_main_loop_begin();
- ecore_dev = _main_thread_mode_touch_device_get(evdev);
- ev->dev = ecore_device_ref(ecore_dev);
- ecore_thread_main_loop_end();
- }
if (!_touch_event_pending_add(evdev, ECORE_EVENT_MOUSE_MOVE, ev))
{
E_Input_Backend *input;
Ecore_Event_Mouse_Button *ev;
uint32_t timestamp, button = 0;
- Ecore_Device *ecore_dev = NULL;
E_Device *e_dev = NULL;
if (!evdev) return;
e_dev = _input_thread_mode_touch_device_get(evdev);
ev->dev = (Eo *)g_object_ref(e_dev);
}
- else
- {
- ecore_thread_main_loop_begin();
- ecore_dev = _main_thread_mode_touch_device_get(evdev);
- ev->dev = ecore_device_ref(ecore_dev);
- ecore_thread_main_loop_end();
- }
if (!_touch_event_pending_add(evdev, ECORE_EVENT_MOUSE_BUTTON_CANCEL, ev))
{
_device_handle_touch_cancel_send(evdev, event);
}
+static void
+_touch_frame_event_add(void *data)
+{
+ E_Input_Evdev *evdev = data;
+
+ _touch_event_pending_flush(evdev);
+ ecore_event_add(E_EVENT_INPUT_TOUCH_FRAME, NULL, NULL, NULL);
+}
EINTERN void
e_input_evdev_handle_touch_frame(E_Input_Evdev *evdev, struct libinput_event_touch *event)
{
EINA_SAFETY_ON_NULL_RETURN(evdev);
- ecore_thread_main_loop_begin();
- _touch_event_pending_flush(evdev);
- ecore_event_add(E_EVENT_INPUT_TOUCH_FRAME, NULL, NULL, NULL);
-
- ecore_thread_main_loop_end();
+ ecore_main_loop_thread_safe_call_async(_touch_frame_event_add, evdev);
}
static void