diff options
author | Chris Michael <cpmichael@osg.samsung.com> | 2016-05-20 11:17:01 -0400 |
---|---|---|
committer | Chris Michael <cpmichael@osg.samsung.com> | 2016-05-20 11:18:21 -0400 |
commit | 6cd9605029742d6f42d050edcfd2bf9289e82008 (patch) | |
tree | b49b2595865825af749929e23cf16b05787b487b | |
parent | 7b2b62318041ceffc1d629402c4603b7b76d5b01 (diff) | |
download | efl-6cd9605029742d6f42d050edcfd2bf9289e82008.tar.gz |
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>
-rw-r--r-- | src/lib/elput/elput_evdev.c | 18 |
1 files changed, 2 insertions, 16 deletions
diff --git a/src/lib/elput/elput_evdev.c b/src/lib/elput/elput_evdev.c index 6f9de940e8..477dc05aea 100644 --- a/src/lib/elput/elput_evdev.c +++ b/src/lib/elput/elput_evdev.c @@ -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); |