[PATCH libinput 3/5] tp_post_twofinger_scroll: Move setting of t->is_pointer = false up a bit

Hans de Goede hdegoede at redhat.com
Tue Jun 24 07:23:11 PDT 2014


There is no need to loop over the touch points twice.

Signed-off-by: Hans de Goede <hdegoede at redhat.com>
---
 src/evdev-mt-touchpad.c | 6 ++----
 1 file changed, 2 insertions(+), 4 deletions(-)

diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c
index 04ea93c..ced9237 100644
--- a/src/evdev-mt-touchpad.c
+++ b/src/evdev-mt-touchpad.c
@@ -453,6 +453,8 @@ tp_post_twofinger_scroll(struct tp_dispatch *tp, uint64_t time)
 			dx += tmpx;
 			dy += tmpy;
 		}
+		/* Stop spurious MOTION events at the end of scrolling */
+		t->is_pointer = false;
 	}
 
 	if (nchanged == 0)
@@ -470,10 +472,6 @@ tp_post_twofinger_scroll(struct tp_dispatch *tp, uint64_t time)
 	if (dx <= -3.0 || dx >= 3.0)
 		tp->scroll.direction |= (1 << LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL);
 
-	/* Stop spurious MOTION events at the end of scrolling */
-	tp_for_each_touch(tp, t)
-		t->is_pointer = false;
-
 	if (dy != 0.0 &&
 	    (tp->scroll.direction & (1 << LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL))) {
 		pointer_notify_axis(&tp->device->base,
-- 
2.0.0



More information about the wayland-devel mailing list