forked from enlightenment/efl
elput: Don't calculate pointer constraints twice
As constraints for pointer movement are already handled in the function which sends the pointer motion event, there is no need to handle them inside the function which gets pointer position. Signed-off-by: Chris Michael <cpmichael@osg.samsung.com>
This commit is contained in:
parent
7b2b623180
commit
6cd9605029
|
@ -680,7 +680,6 @@ _pointer_motion(struct libinput_device *idev, struct libinput_event_pointer *eve
|
|||
{
|
||||
Elput_Device *edev;
|
||||
Elput_Pointer *ptr;
|
||||
double x, y;
|
||||
|
||||
edev = libinput_device_get_user_data(idev);
|
||||
if (!edev) return EINA_FALSE;
|
||||
|
@ -688,21 +687,8 @@ _pointer_motion(struct libinput_device *idev, struct libinput_event_pointer *eve
|
|||
ptr = _evdev_pointer_get(edev->seat);
|
||||
if (!ptr) return EINA_FALSE;
|
||||
|
||||
x = ptr->x + libinput_event_pointer_get_dx(event);
|
||||
y = ptr->y + libinput_event_pointer_get_dy(event);
|
||||
|
||||
if (x < ptr->minx)
|
||||
x = ptr->minx;
|
||||
else if (x >= ptr->minx + ptr->maxw)
|
||||
x = ptr->minx + ptr->maxw - 1;
|
||||
|
||||
if (y < ptr->miny)
|
||||
y = ptr->miny;
|
||||
else if (y >= ptr->miny + ptr->maxh)
|
||||
y = ptr->miny + ptr->maxh - 1;
|
||||
|
||||
ptr->x = x;
|
||||
ptr->y = y;
|
||||
ptr->x += libinput_event_pointer_get_dx(event);
|
||||
ptr->y += libinput_event_pointer_get_dy(event);
|
||||
ptr->timestamp = libinput_event_pointer_get_time(event);
|
||||
|
||||
_pointer_motion_send(edev);
|
||||
|
|
Loading…
Reference in New Issue