-#include "e.h"
-#include "e_input_private.h"
-#include "e_device.h"
-#include "e_keyrouter_private.h"
+#include "e_input_intern.h"
+#include "e_input_log.h"
#include "e_input_event.h"
-#include "e_devicemgr.h"
+#include "e_keyrouter_intern.h"
+#include "e_devicemgr_intern.h"
+#include "e_device_intern.h"
+#include "e_comp_screen_intern.h"
+#include "e_output_intern.h"
#include <glib.h>
+#include <ctype.h>
#define G_LIST_GET_DATA(list) ((list) ? (((GList *)(list))->data) : NULL)
edev->mouse.maxw = w;
edev->mouse.maxh = h;
- if (libinput_device_has_capability(edev->device, LIBINPUT_DEVICE_CAP_POINTER))
+ if (edev->caps & E_INPUT_SEAT_POINTER)
{
edev->seat->ptr.dx = (double)(w / 2);
edev->seat->ptr.dy = (double)(h / 2);
//LCOV_EXCL_START
#ifdef _F_E_INPUT_ENABLE_DEVICE_CALIBRATION_
- const char *sysname;
float cal[6];
- const char *device;
- Eina_List *devices;
if ((!libinput_device_config_calibration_has_matrix(edev->device)) ||
(libinput_device_config_calibration_get_default_matrix(edev->device, cal) != 0))
return;
- sysname = libinput_device_get_sysname(edev->device);
-
- devices = eeze_udev_find_by_subsystem_sysname("input", sysname);
- if (eina_list_count(devices) < 1) return;
-
#ifdef _F_E_INPUT_USE_WL_CALIBRATION_
const char *vals;
enum libinput_config_status status;
+ struct udev_device *udev_device = NULL;
- EINA_LIST_FREE(devices, device)
+ udev_device = libinput_device_get_udev_device(edev->device);
+ if (!udev_device)
{
- vals = eeze_udev_syspath_get_property(device, "WL_CALIBRATION");
- if ((!vals) ||
- (sscanf(vals, "%f %f %f %f %f %f",
- &cal[0], &cal[1], &cal[2], &cal[3], &cal[4], &cal[5]) != 6))
- goto cont;
+ ERR("no udev_device");
+ return;
+ }
- cal[2] /= w;
- cal[5] /= h;
+ vals = udev_device_get_property_value(udev_device, "WL_CALIBRATION");
+ if ((!vals) ||
+ (sscanf(vals, "%f %f %f %f %f %f",
+ &cal[0], &cal[1], &cal[2], &cal[3], &cal[4], &cal[5]) != 6))
+ {
+ udev_device_unref(udev_device);
+ return;
+ }
+ udev_device_unref(udev_device);
- status =
- libinput_device_config_calibration_set_matrix(edev->device, cal);
+ ELOGF("E_INPUT_EVDEV", "calibration_set cal[%lf %lf %lf %lf %lf %lf] (%d x %d)",
+ NULL, cal[0], cal[1], cal[2], cal[3], cal[4], cal[5], w, h);
- if (status != LIBINPUT_CONFIG_STATUS_SUCCESS)
- ERR("Failed to apply calibration");
+ status =
+ libinput_device_config_calibration_set_matrix(edev->device, cal);
-cont:
- eina_stringshare_del(device);
- continue;
- }
+ if (status != LIBINPUT_CONFIG_STATUS_SUCCESS)
+ ERR("Failed to apply calibration");
#endif//_F_E_INPUT_USE_WL_CALIBRATION_
#endif//_F_E_INPUT_ENABLE_DEVICE_CALIBRATION_
//LCOV_EXCL_STOP
}
}
- ei->touch_device_count++;
- ELOGF("E_INPUT_EVDEV_TOUCH", "Touch device count is %d.\n", NULL, ei->touch_device_count);
+ ELOGF("E_INPUT_EVDEV_TOUCH", "Touch max count is %d.\n", NULL, ei->touch_max_count);
}
static void
if (!(input = edev->seat->input)) return;
if (!input->dev->xkb_ctx) return;
- g_mutex_init(&edev->xkb.keymap_mutex);
-
/* create keymap from xkb context */
- g_mutex_lock(&edev->xkb.keymap_mutex);
edev->xkb.keymap = _e_input_device_cached_keymap_get(input->dev->xkb_ctx, NULL, 0);
if (!edev->xkb.keymap)
{
- g_mutex_unlock(&edev->xkb.keymap_mutex);
ERR("Failed to create keymap: %m");
return;
}
- g_mutex_lock(&edev->xkb.state_mutex);
-
/* create xkb state */
if (!(edev->xkb.state = xkb_state_new(edev->xkb.keymap)))
{
- g_mutex_unlock(&edev->xkb.state_mutex);
- g_mutex_unlock(&edev->xkb.keymap_mutex);
ERR("Failed to create xkb state: %m");
return;
}
- g_mutex_unlock(&edev->xkb.state_mutex);
-
xkb_idx = xkb_map_mod_get_index(edev->xkb.keymap, XKB_MOD_NAME_CTRL);
if (xkb_idx != XKB_MOD_INVALID)
edev->xkb.ctrl_mask = 1 << xkb_idx;
edev->xkb.altgr_mask = 1 << xkb_idx;
else
edev->xkb.altgr_mask = 0;
-
- g_mutex_unlock(&edev->xkb.keymap_mutex);
}
static int
{
xkb_mod_mask_t mask;
- g_mutex_lock(&from->xkb.state_mutex);
-
edev->xkb.depressed =
xkb_state_serialize_mods(from->xkb.state, XKB_STATE_DEPRESSED);
edev->xkb.latched =
edev->xkb.group =
xkb_state_serialize_mods(from->xkb.state, XKB_STATE_EFFECTIVE);
- g_mutex_unlock(&from->xkb.state_mutex);
-
mask = (edev->xkb.depressed | edev->xkb.latched);
if (mask & from->xkb.ctrl_mask)
}
static void
+_e_input_event_mouse_relative_move_cb_free(void *data EINA_UNUSED, void *event)
+{
+ Ecore_Event_Mouse_Relative_Move *ev = event;
+
+ if (ev->dev) ecore_device_unref(ev->dev);
+
+ free(ev);
+}
+
+static void
_e_input_event_mouse_wheel_cb_free(void *data EINA_UNUSED, void *event)
{
Ecore_Event_Mouse_Wheel *ev = event;
E_Comp_Config *comp_conf = NULL;
int *pressed_keycode = NULL, *idata = NULL;
Eina_Bool dup_found = EINA_FALSE;
- const char* device_name = NULL;
+ const char *device_name = NULL;
Ecore_Device_Subclass device_subclas = ECORE_DEVICE_SUBCLASS_NONE;
if (!(edev = libinput_device_get_user_data(device)))
if ((edev->seat->dev->blocked & E_INPUT_SEAT_KEYBOARD) ||
(edev->seat->dev->server_blocked & E_INPUT_SEAT_KEYBOARD))
{
+ void *blocked_client = atomic_load(&edev->seat->dev->blocked_client);
ELOGF("Key", "Press (keycode: %d, device: %s) is blocked by %p, server: 0x%x", NULL,
- code, device_name, edev->seat->dev->blocked_client,
+ code, device_name, blocked_client,
edev->seat->dev->server_blocked);
return;
}
}
if (!dup_found)
{
+ void *blocked_client = atomic_load(&edev->seat->dev->blocked_client);
ELOGF("Key", "Release (keycode: %d, device: %s) is blocked by %p", NULL,
- code, device_name, edev->seat->dev->blocked_client);
+ code, device_name, blocked_client);
return;
}
}
{
if (e_devicemgr_keyboard_grab_subtype_is_grabbed(device_subclas))
{
- func(code, state, timestamp);
+ if (!e_input_thread_mode_get())
+ func(code, state, timestamp, ecore_dev);
+ else
+ func(code, state, timestamp, e_dev);
return;
}
}
- g_mutex_lock(&edev->xkb.state_mutex);
xkb_state_update_key(edev->xkb.state, code,
(state ? XKB_KEY_DOWN : XKB_KEY_UP));
/* get the keysym for this code */
nsyms = xkb_key_get_syms(edev->xkb.state, code, &syms);
- g_mutex_unlock(&edev->xkb.state_mutex);
if (nsyms == 1) sym = syms[0];
}
/* if shift is active, we need to transform the key to lower */
- g_mutex_lock(&edev->xkb.keymap_mutex);
- g_mutex_lock(&edev->xkb.state_mutex);
if (xkb_state_mod_index_is_active(edev->xkb.state,
xkb_map_mod_get_index(edev->xkb.keymap,
XKB_MOD_NAME_SHIFT),
if (keyname[0] != '\0')
keyname[0] = tolower(keyname[0]);
}
- g_mutex_unlock(&edev->xkb.keymap_mutex);
- g_mutex_unlock(&edev->xkb.state_mutex);
if (_device_keysym_translate(sym, edev->xkb.modifiers,
compose_buffer, sizeof(compose_buffer)))
if (comp_conf && comp_conf->input_log_enable)
ELOGF("Key", "%s (keyname: %s, keycode: %d, timestamp: %u, device: %s)", NULL, state?"Press":"Release", e->keyname, e->keycode, e->timestamp, device_name);
+ if (e_config->key_input_ttrace_enable)
+ {
+ TRACE_INPUT_BEGIN(ECORE_EVENT_KEY:%s:%s:%u:%lld, state ? "PRESS" : "RELEASE", e->keyname, timestamp, (long long unsigned int)libinput_event_keyboard_get_time_usec(event));
+ ELOGF("INPUT", "ECORE_EVENT_KEY:%s:%s:%u:%lld|B|", NULL, state ? "PRESS" : "RELEASE", e->keyname, timestamp, (long long unsigned int)libinput_event_keyboard_get_time_usec(event));
+ }
+
+ _e_input_key_event_list_add(e);
+
if (e_input_thread_mode_get())
{
e->dev = (Eo *)g_object_ref(e_dev);
ecore_event_add(state ? ECORE_EVENT_KEY_DOWN : ECORE_EVENT_KEY_UP, e, _e_input_event_key_cb_free, NULL);
}
+ if (e_config->key_input_ttrace_enable)
+ {
+ TRACE_INPUT_END();
+ ELOGF("INPUT", "ECORE_EVENT_KEY|E|", NULL);
+ }
+
if (tmp) free(tmp);
}
}
static void
+_device_pointer_relative_motion(E_Input_Evdev *edev, struct libinput_event_pointer *event, double dx[2], double dy[2])
+{
+ 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;
+
+ if (!(input = edev->seat->input)) return;
+
+ 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(libinput_device_get_name(edev->device)))
+ {
+ 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->event_window = (Ecore_Window)input->dev->window;
+ if (event) ev->timestamp = libinput_event_pointer_get_time(event);
+
+ ev->modifiers = edev->xkb.modifiers;
+
+ ev->dx = (int)dx[0];
+ ev->dy = (int)dy[0];
+ 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));
+
+ ecore_event_add(ECORE_EVENT_MOUSE_RELATIVE_MOVE, ev, _e_input_event_mouse_relative_move_cb_free, NULL);
+
+end:
+ ecore_thread_main_loop_end();
+}
+
+static void
_device_pointer_motion_send(E_Input_Evdev *edev, struct libinput_event_pointer *event, double dx[2], double dy[2])
{
- uint64_t time_us;
e_input_relative_motion_cb func = e_input_relative_motion_handler_get();
if (func)
{
- time_us = libinput_event_pointer_get_time_usec(event);
- func(dx, dy, time_us);
+ //func(dx, dy, time_us);
+ _device_pointer_relative_motion(edev, event, dx, dy);
}
else
{
+ double seat_dx, seat_dy, temp;
+ if (edev->disable_acceleration)
+ {
+ seat_dx = dx[1];
+ seat_dy = dy[1];
+ }
+ else
+ {
+ seat_dx = dx[0];
+ seat_dy = dy[0];
+ }
+
+ if (edev->seat->ptr.swap)
+ {
+ temp = seat_dx;
+ seat_dx = seat_dy;
+ seat_dy = temp;
+ }
+ if (edev->seat->ptr.invert_x)
+ seat_dx *= -1;
+ if (edev->seat->ptr.invert_y)
+ seat_dy *= -1;
+
+ edev->seat->ptr.dx += seat_dx;
+ edev->seat->ptr.dy += seat_dy;
+
+ edev->mouse.dx = edev->seat->ptr.dx;
+ edev->mouse.dy = edev->seat->ptr.dy;
+
+ if (floor(edev->seat->ptr.dx) == edev->seat->ptr.ix &&
+ floor(edev->seat->ptr.dy) == edev->seat->ptr.iy)
+ {
+ return;
+ }
+
+ edev->seat->ptr.ix = edev->seat->ptr.dx;
+ edev->seat->ptr.iy = edev->seat->ptr.dy;
+
+ if ((edev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
+ (edev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
+ {
+ return;
+ }
+
_device_pointer_motion(edev, event);
}
}
E_Input_Evdev *edev;
double delta_x[2]; /* delta_x[0] for accelerated, delta_x[1] for unaccelerated */
double delta_y[2]; /* delta_y[0] for accelerated, delta_y[1] for unaccelerated */
- double dx, dy, temp;
if (!(edev = libinput_device_get_user_data(device)))
{
delta_y[0] = libinput_event_pointer_get_dy(event);
delta_y[1] = libinput_event_pointer_get_dy_unaccelerated(event);
- if (edev->disable_acceleration)
- {
- dx = delta_x[1];
- dy = delta_y[1];
- }
- else
- {
- dx = delta_x[0];
- dy = delta_y[0];
- }
-
- if (edev->seat->ptr.swap)
- {
- temp = dx;
- dx = dy;
- dy = temp;
- }
- if (edev->seat->ptr.invert_x)
- dx *= -1;
- if (edev->seat->ptr.invert_y)
- dy *= -1;
-
- edev->seat->ptr.dx += dx;
- edev->seat->ptr.dy += dy;
-
- edev->mouse.dx = edev->seat->ptr.dx;
- edev->mouse.dy = edev->seat->ptr.dy;
-
- if (floor(edev->seat->ptr.dx) == edev->seat->ptr.ix &&
- floor(edev->seat->ptr.dy) == edev->seat->ptr.iy)
- {
- return;
- }
-
- edev->seat->ptr.ix = edev->seat->ptr.dx;
- edev->seat->ptr.iy = edev->seat->ptr.dy;
-
- if ((edev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
- (edev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
- {
- return;
- }
-
_device_pointer_motion_send(edev, event, &delta_x[0], &delta_y[0]);
}
if (button == 3) button = 2;
else if (button == 2) button = 3;
+ void *blocked_client = atomic_load(&edev->seat->dev->blocked_client);
+
if (state)
{
if ((edev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
(edev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
{
+
ELOGF("Mouse", "Button Press (btn: %d, device: %s) is blocked by %p, server: 0x%x", NULL,
- button, ecore_device_name_get(ecore_dev), edev->seat->dev->blocked_client,
+ button, ecore_device_name_get(ecore_dev), blocked_client,
edev->seat->dev->server_blocked);
goto end;
}
if (!(edev->mouse.pressed_button & (1 << button)))
{
ELOGF("Mouse", "Button Release (btn: %d, device: %s) is blocked by %p, server: 0x%x", NULL,
- button, ecore_device_name_get(ecore_dev), edev->seat->dev->blocked_client,
+ button, ecore_device_name_get(ecore_dev), blocked_client,
edev->seat->dev->server_blocked);
goto end;
}
if ((edev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
(edev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
{
+ void *blocked_client = atomic_load(&edev->seat->dev->blocked_client);
+
if (detent_data)
ELOGF("Mouse", "Detent (direction: %d, value: %d) is blocked by %p, server: 0x%x", NULL,
- direction, z, edev->seat->dev->blocked_client, edev->seat->dev->server_blocked);
+ direction, z, blocked_client, edev->seat->dev->server_blocked);
else
ELOGF("Mouse", "Wheel (direction: %d, value: %d) is blocked by %p, server: 0x%x", NULL,
- direction, z, edev->seat->dev->blocked_client, edev->seat->dev->server_blocked);
+ direction, z, blocked_client, edev->seat->dev->server_blocked);
+
goto end;
}
value = libinput_event_pointer_get_scroll_value(pointer_event, axis);
if (comp_conf && comp_conf->input_log_enable)
{
- ELOGF("Scroll", "SOURCE_WHEELL value_v120: %lf (cf. value: %lf)", NULL, value_v120, value);
+ ELOGF("Scroll", "SOURCE_WHEEL value_v120: %lf (cf. value: %lf)", NULL, value_v120, value);
}
if (((int)value_v120 % E_INPUT_POINTER_AXIS_DISCRETE_STEP) != 0)
{
if ((edev->seat->dev->blocked & E_INPUT_SEAT_POINTER) ||
(edev->seat->dev->server_blocked & E_INPUT_SEAT_POINTER))
{
+ void *blocked_client = atomic_load(&edev->seat->dev->blocked_client);
if (detent_data)
ELOGF("Mouse", "Detent (direction: %d, value: %d) is blocked by %p, server: 0x%x", NULL,
- direction, z, edev->seat->dev->blocked_client, edev->seat->dev->server_blocked);
+ direction, z, blocked_client, edev->seat->dev->server_blocked);
else
ELOGF("Mouse", "Wheel (direction: %d, value: %d) is blocked by %p, server: 0x%x", NULL,
- direction, z, edev->seat->dev->blocked_client, edev->seat->dev->server_blocked);
+ direction, z, blocked_client, edev->seat->dev->server_blocked);
+
goto end;
}
edev->mouse.miny = output->config.geom.y;
edev->mouse.maxw = output->config.geom.w;
edev->mouse.maxh = output->config.geom.h;
- if (libinput_device_has_capability(edev->device, LIBINPUT_DEVICE_CAP_POINTER))
+ if (edev->caps & E_INPUT_SEAT_POINTER)
{
edev->seat->ptr.dx = (double)(edev->mouse.maxw / 2);
edev->seat->ptr.dy = (double)(edev->mouse.maxh / 2);
if (comp_conf && comp_conf->input_log_enable)
ELOGF("Touch", "Down (id: %d, x: %d, y: %d)", NULL, edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy);
- edev->touch.raw_pressed |= (1 << edev->mt_slot);
+ atomic_fetch_or(&edev->touch.raw_pressed, (1 << edev->mt_slot));
if (edev->touch.blocked)
{
+ void *blocked_client = atomic_load(&edev->seat->dev->blocked_client);
ELOGF("Touch", "Down (id: %d, x: %d, y: %d) is blocked by %p, server: 0x%x", NULL,
- edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy, edev->seat->dev->blocked_client,
+ edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy, blocked_client,
edev->seat->dev->server_blocked);
return;
}
if (comp_conf && comp_conf->input_log_enable)
ELOGF("Touch", "Up (id: %d, x: %d, y: %d)", NULL, edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy);
- edev->touch.raw_pressed &= ~(1 << edev->mt_slot);
+ atomic_fetch_and(&edev->touch.raw_pressed, ~(1 << edev->mt_slot));
if (edev->touch.blocked)
{
if (!(edev->touch.pressed & (1 << edev->mt_slot)))
{
+ void *blocked_client = atomic_load(&edev->seat->dev->blocked_client);
ELOGF("Touch", "Up (id: %d, x: %d, y: %d) is blocked by %p, server(0x%x)", NULL,
- edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy, edev->seat->dev->blocked_client,
+ edev->mt_slot, edev->seat->ptr.ix, edev->seat->ptr.iy, blocked_client,
edev->seat->dev->server_blocked);
+
if (edev->touch.raw_pressed == 0x0)
{
edev->touch.blocked = EINA_FALSE;
_e_input_evdev_device_destroy(E_Input_Evdev *edev)
{
Ecore_Device *dev;
-
EINA_SAFETY_ON_NULL_RETURN(edev);
ecore_thread_main_loop_begin();
if (edev->caps & E_INPUT_SEAT_KEYBOARD)
{
- g_mutex_lock(&edev->xkb.state_mutex);
if (edev->xkb.state) xkb_state_unref(edev->xkb.state);
- g_mutex_unlock(&edev->xkb.state_mutex);
- g_mutex_lock(&edev->xkb.keymap_mutex);
if (edev->xkb.keymap) xkb_map_unref(edev->xkb.keymap);
- g_mutex_unlock(&edev->xkb.keymap_mutex);
}
if (edev->ecore_dev) ecore_device_del(edev->ecore_dev);
{
ecore_device_del(dev);
}
+
+ if (edev->e_dev) g_object_unref(edev->e_dev);
+ if (edev->e_dev_list)
+ {
+ GList *glist = edev->e_dev_list;
+ E_Device *e_dev;
+ while (glist)
+ {
+ e_dev = glist->data;
+ g_object_unref(e_dev);
+
+ glist = g_list_next(glist);
+ }
+ }
if (edev->path) eina_stringshare_del(edev->path);
if (edev->device) libinput_device_unref(edev->device);
if (edev->key_remap_hash) eina_hash_free(edev->key_remap_hash);
EINTERN void
e_input_evdev_axis_size_set(E_Input_Evdev *edev, int w, int h)
{
- const char *sysname;
float cal[6];
- const char *device;
- Eina_List *devices;
const char *vals;
enum libinput_config_status status;
+ struct udev_device *udev_device = NULL;
EINA_SAFETY_ON_NULL_RETURN(edev);
EINA_SAFETY_ON_TRUE_RETURN((w == 0) || (h == 0));
(libinput_device_config_calibration_get_default_matrix(edev->device, cal) != 0))
return;
- sysname = libinput_device_get_sysname(edev->device);
-
- devices = eeze_udev_find_by_subsystem_sysname("input", sysname);
- if (eina_list_count(devices) < 1) return;
+ udev_device = libinput_device_get_udev_device(edev->device);
+ if (!udev_device)
+ {
+ ERR("no udev_device");
+ return;
+ }
- EINA_LIST_FREE(devices, device)
+ vals = udev_device_get_property_value(udev_device, "WL_CALIBRATION");
+ if ((!vals) ||
+ (sscanf(vals, "%f %f %f %f %f %f",
+ &cal[0], &cal[1], &cal[2], &cal[3], &cal[4], &cal[5]) != 6))
{
- vals = eeze_udev_syspath_get_property(device, "WL_CALIBRATION");
- if ((!vals) ||
- (sscanf(vals, "%f %f %f %f %f %f",
- &cal[0], &cal[1], &cal[2], &cal[3], &cal[4], &cal[5]) != 6))
- goto cont;
+ udev_device_unref(udev_device);
+ return;
+ }
+ udev_device_unref(udev_device);
- cal[2] /= w;
- cal[5] /= h;
+ ELOGF("E_INPUT_EVDEV", "axis_size_set cal[%lf %lf %lf %lf %lf %lf] (%d x %d)",
+ NULL, cal[0], cal[1], cal[2], cal[3], cal[4], cal[5], w, h);
- status =
- libinput_device_config_calibration_set_matrix(edev->device, cal);
+ cal[2] /= w;
+ cal[5] /= h;
- if (status != LIBINPUT_CONFIG_STATUS_SUCCESS)
- ERR("Failed to apply calibration");
+ status =
+ libinput_device_config_calibration_set_matrix(edev->device, cal);
-cont:
- eina_stringshare_del(device);
- continue;
- }
+ if (status != LIBINPUT_CONFIG_STATUS_SUCCESS)
+ ERR("Failed to apply calibration");
}
EINTERN const char *
{
input = evdev->seat->input;
if (!input) return EINA_FALSE;
+
if (libinput_dispatch(input->libinput) != 0)
{
ERR("Failed to dispatch libinput events: %m");
+
return EINA_FALSE;
}
return res;
}
-
-EINTERN Eina_Bool
-e_input_evdev_mouse_accel_enable(E_Input_Evdev *edev, Eina_Bool enable)
-{
- EINA_SAFETY_ON_NULL_RETURN_VAL(edev, EINA_FALSE);
- edev->disable_acceleration = !enable;
-
- return EINA_TRUE;
-}