e_input_device_pointer_warp(E_Input_Device *dev, int x, int y)
{
E_Input_Seat *seat;
- E_Input_Evdev *edev;
+ E_Input_Evdev *edev, *warp_dev;
Eina_List *l, *ll;
Eina_Bool found = EINA_FALSE;
+ char *device_name = NULL, *device_path = NULL;
if (!dev)
dev = _e_input_device_default_get();
+ if (e_devicemgr && e_devicemgr->last_device_ptr)
+ {
+ device_name = (char *)e_devicemgr->last_device_ptr->name;
+ device_path = (char *)e_devicemgr->last_device_ptr->identifier;
+ }
+
/* check for valid device */
EINA_SAFETY_ON_TRUE_RETURN_VAL(!dev, EINA_FALSE);
EINA_LIST_FOREACH(dev->seats, l, seat)
{
+ warp_dev = NULL;
EINA_LIST_FOREACH(seat->devices, ll, edev)
{
if (!libinput_device_has_capability(edev->device,
LIBINPUT_DEVICE_CAP_POINTER))
continue;
+ if (!e_util_strcmp(libinput_device_get_name(edev->device), device_name) &&
+ !e_util_strcmp(edev->path, device_path))
+ {
+ warp_dev = edev;
+ break;
+ }
+
+ if (!warp_dev) warp_dev = edev;
+ }
+
+ if (warp_dev)
+ {
seat->ptr.dx = seat->ptr.ix = x;
seat->ptr.dy = seat->ptr.iy = y;
_e_input_pointer_motion_post(edev);