static void _pointer_touch_ecore_event_add(void *data);
static void _input_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 void _e_input_aux_data_event_free(void *user_data, void *ev);
+static E_Device * _input_thread_mode_touch_device_get(E_Input_Evdev *evdev);
static Eina_Bool _touch_blocked_by_palm, _touch_up_blocked_by_palm;
return e_dev;
}
+static Eo *
+_input_thread_mode_device_get(E_Input_Evdev *evdev, Eina_Bool touch_event)
+{
+ E_Device *e_dev = NULL;
+
+ if (e_input_thread_mode_get() && e_input_pointer_thread_mode_get())
+ {
+ if (touch_event)
+ e_dev = _input_thread_mode_touch_device_get(evdev);
+ else
+ e_dev = _input_thread_mode_pointer_device_get(evdev);
+
+ return (Eo *)g_object_ref(e_dev);
+ }
+
+ return NULL;
+}
+
static Ecore_Event_Mouse_Move *
-_mouse_move_event_create(E_Input_Evdev *evdev, uint32_t timestamp, double radius_x, double radius_y, double pressure, double angle)
+_mouse_move_event_create(E_Input_Evdev *evdev, uint32_t timestamp, double radius_x, double radius_y, double pressure, double angle, Eina_Bool touch)
{
E_Input_Backend *input = NULL;
Ecore_Event_Mouse_Move *ev = NULL;
ev->multi.root.x = ev->x;
ev->multi.root.y = ev->y;
+ ev->dev = _input_thread_mode_device_get(evdev, touch);
+
return ev;
}
static void
_device_pointer_motion(E_Input_Evdev *evdev, struct libinput_event_pointer *event)
{
- E_Device *e_dev = NULL;
Ecore_Event_Mouse_Move *ev;
E_Input_Backend *input;
uint32_t timestamp = 0;
else
timestamp = e_util_timestamp_get();
- ev = _mouse_move_event_create(evdev, timestamp, 1, 1, 1.0, 0.0);
+ ev = _mouse_move_event_create(evdev, timestamp, 1, 1, 1.0, 0.0, EINA_FALSE);
if (!ev) return;
evdev->mouse.dx = e_input_seat_pointer_dx_get(evdev->seat);
evdev->mouse.dy = e_input_seat_pointer_dy_get(evdev->seat);
- if (e_input_thread_mode_get() && e_input_pointer_thread_mode_get())
- {
- e_dev = _input_thread_mode_pointer_device_get(evdev);
- ev->dev = (Eo *)g_object_ref(e_dev);
- }
-
_input_event_add(evdev, ECORE_EVENT_MOUSE_MOVE, EINA_FALSE, ev, _e_input_event_mouse_move_cb_free, NULL);
}
}
static Ecore_Event_Mouse_Button *
-_mouse_button_event_create(E_Input_Evdev *evdev, uint32_t timestamp, double radius_x, double radius_y, double pressure, double angle)
+_mouse_button_event_create(E_Input_Evdev *evdev, uint32_t timestamp, double radius_x, double radius_y, double pressure, double angle, Eina_Bool touch)
{
E_Input_Backend *input = NULL;
Ecore_Event_Mouse_Button *ev = NULL;
ev->multi.root.x = ev->x;
ev->multi.root.y = ev->y;
+ ev->dev = _input_thread_mode_device_get(evdev, touch);
+
return ev;
}
Ecore_Event_Mouse_Button *ev;
enum libinput_button_state state;
uint32_t button, timestamp;
- E_Device *e_dev = NULL;
E_Comp_Config *comp_conf = NULL;
const char *device_name = NULL;
evdev->mouse.pressed_button &= ~(1 << button);
}
- ev = _mouse_button_event_create(evdev, timestamp, 1, 1, 1.0, 0.0);
+ ev = _mouse_button_event_create(evdev, timestamp, 1, 1, 1.0, 0.0, EINA_FALSE);
if (!ev) return;
if (state)
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));
- if (e_input_thread_mode_get() && e_input_pointer_thread_mode_get())
- {
- e_dev = _input_thread_mode_pointer_device_get(evdev);
- ev->dev = (Eo *)g_object_ref(e_dev);
- }
-
_input_event_add(evdev, state? ECORE_EVENT_MOUSE_BUTTON_DOWN : ECORE_EVENT_MOUSE_BUTTON_UP, EINA_FALSE, ev, _e_input_event_mouse_button_cb_free, NULL);
}
uint32_t timestamp;
enum libinput_pointer_axis axis;
Ecore_Device *detent_data = NULL;
- E_Device *e_dev = NULL;
E_Comp_Config *comp_conf = NULL;
int direction = 0, z = 0;
E_Input_Device *dev = NULL;
ELOGF("Mouse", "Wheel (direction: %d, value: %d)", NULL, ev->direction, ev->z);
}
- if (e_input_thread_mode_get() && e_input_pointer_thread_mode_get())
- {
- e_dev = _input_thread_mode_pointer_device_get(evdev);
- ev->dev = (Eo *)g_object_ref(e_dev);
- }
+ ev->dev = _input_thread_mode_device_get(evdev, EINA_FALSE);
_input_event_add(evdev, ECORE_EVENT_MOUSE_WHEEL, EINA_FALSE, ev, _e_input_event_mouse_wheel_cb_free, NULL);
}
E_Input_Backend *input;
Ecore_Event_Mouse_Button *ev;
uint32_t timestamp, button = 0;
- E_Device *e_dev = NULL;
double radius_x = 1;
double radius_y = 1;
double pressure = 1.0;
angle = libinput_event_touch_get_orientation(event);
}
- ev = _mouse_button_event_create(evdev, timestamp, radius_x, radius_y, pressure, angle);
+ ev = _mouse_button_event_create(evdev, timestamp, radius_x, radius_y, pressure, angle, EINA_TRUE);
if (!ev) return;
if (state == ECORE_EVENT_MOUSE_BUTTON_DOWN)
if (evdev->mouse.did_triple)
ev->triple_click = 1;
- if (e_input_thread_mode_get() && e_input_pointer_thread_mode_get())
- {
- e_dev = _input_thread_mode_touch_device_get(evdev);
- ev->dev = (Eo *)g_object_ref(e_dev);
- }
-
if (!_touch_event_pending_add(evdev, state, ev))
{
ELOGF("Touch", "Failed to pend event (%s). Call ecore_event_add immediately.", NULL,
{
E_Input_Backend *input;
Ecore_Event_Mouse_Move *ev;
- 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_Comp_Config *comp_conf = NULL;
if (libinput_event_touch_has_orientation(event))
angle = libinput_event_touch_get_orientation(event);
- ev = _mouse_move_event_create(evdev, timestamp, radius_x, radius_y, pressure, angle);
+ ev = _mouse_move_event_create(evdev, timestamp, radius_x, radius_y, pressure, angle, EINA_TRUE);
if (!ev) return;
- if (e_input_thread_mode_get() && e_input_pointer_thread_mode_get())
- {
- e_dev = _input_thread_mode_touch_device_get(evdev);
- ev->dev = (Eo *)g_object_ref(e_dev);
- }
-
comp_conf = e_comp_config_get();
if (comp_conf && comp_conf->input_log_enable)
ELOGF("Touch", "Move (id: %d, x: %d, y: %d)", NULL, evdev->mt_slot, ev->x, ev->y);
E_Input_Backend *input;
Ecore_Event_Mouse_Button *ev;
uint32_t timestamp, button = 0;
- E_Device *e_dev = NULL;
E_Comp_Config *comp_conf = NULL;
if (!evdev) return;
timestamp = libinput_event_touch_get_time(event);
- ev = _mouse_button_event_create(evdev, timestamp, 1, 1, 1.0, 0.0);
+ ev = _mouse_button_event_create(evdev, timestamp, 1, 1, 1.0, 0.0, EINA_TRUE);
if (!ev) return;
evdev->touch.pressed &= ~(1 << ev->multi.device);
ev->buttons = ((button & 0x00F) + 1);
- if (e_input_thread_mode_get() && e_input_pointer_thread_mode_get())
- {
- e_dev = _input_thread_mode_touch_device_get(evdev);
- ev->dev = (Eo *)g_object_ref(e_dev);
- }
-
comp_conf = e_comp_config_get();
if (comp_conf && comp_conf->input_log_enable)
ELOGF("Touch", "Cancel (x: %d, y: %d, timestamp: %u (current time), device: %s)", NULL,