mirror of
https://gitlab.freedesktop.org/libinput/libinput.git
synced 2026-05-06 03:28:00 +02:00
tp_post_twofinger_scroll: Move setting of t->is_pointer = false up a bit
There is no need to loop over the touch points twice. Signed-off-by: Hans de Goede <hdegoede@redhat.com> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
c0af1b57d4
commit
8d6356e668
1 changed files with 2 additions and 4 deletions
|
|
@ -453,6 +453,8 @@ tp_post_twofinger_scroll(struct tp_dispatch *tp, uint64_t time)
|
||||||
dx += tmpx;
|
dx += tmpx;
|
||||||
dy += tmpy;
|
dy += tmpy;
|
||||||
}
|
}
|
||||||
|
/* Stop spurious MOTION events at the end of scrolling */
|
||||||
|
t->is_pointer = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (nchanged == 0)
|
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)
|
if (dx <= -3.0 || dx >= 3.0)
|
||||||
tp->scroll.direction |= (1 << LIBINPUT_POINTER_AXIS_SCROLL_HORIZONTAL);
|
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 &&
|
if (dy != 0.0 &&
|
||||||
(tp->scroll.direction & (1 << LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL))) {
|
(tp->scroll.direction & (1 << LIBINPUT_POINTER_AXIS_SCROLL_VERTICAL))) {
|
||||||
pointer_notify_axis(&tp->device->base,
|
pointer_notify_axis(&tp->device->base,
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue