diff options
author | Peter Hutterer <peter.hutterer@who-t.net> | 2016-05-30 18:46:54 +1000 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2016-06-01 15:31:43 +1000 |
commit | 031b7fb79b7af7bfc20315d6ba46dbf686be2dc6 (patch) | |
tree | 855efb3745b78711e63b72aa10a9c7cbaebbb18c /src/evdev-mt-touchpad-edge-scroll.c | |
parent | cf707baace3f87360ece667f25ba45acc87e9a18 (diff) |
touchpad: short-circuit the edge scroll handling when it's not enabled
No need to handle events properly in the edge scroll state machine when it's
not enabled. Just set any beginning touch to state AREA and move on. The rest
of the code guarantees neutral state when edge scrolling is enabled or
disabled.
This reduces the debug output produced by libinput-debug-events when edge
scrolling is disabled, preventing users from seemingly identifying
bugs where there are none.
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Reviewed-by: Hans de Goede <hdegoede@redhat.com>
Diffstat (limited to 'src/evdev-mt-touchpad-edge-scroll.c')
-rw-r--r-- | src/evdev-mt-touchpad-edge-scroll.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/src/evdev-mt-touchpad-edge-scroll.c b/src/evdev-mt-touchpad-edge-scroll.c index fcc0512..8222bba 100644 --- a/src/evdev-mt-touchpad-edge-scroll.c +++ b/src/evdev-mt-touchpad-edge-scroll.c @@ -318,6 +318,15 @@ tp_edge_scroll_handle_state(struct tp_dispatch *tp, uint64_t time) { struct tp_touch *t; + if (tp->scroll.method != LIBINPUT_CONFIG_SCROLL_EDGE) { + tp_for_each_touch(tp, t) { + if (t->state == TOUCH_BEGIN) + t->scroll.edge_state = + EDGE_SCROLL_TOUCH_STATE_AREA; + } + return; + } + tp_for_each_touch(tp, t) { if (!t->dirty) continue; @@ -350,9 +359,6 @@ tp_edge_scroll_post_events(struct tp_dispatch *tp, uint64_t time) const struct normalized_coords zero = { 0.0, 0.0 }; const struct discrete_coords zero_discrete = { 0.0, 0.0 }; - if (tp->scroll.method != LIBINPUT_CONFIG_SCROLL_EDGE) - return 0; - tp_for_each_touch(tp, t) { if (!t->dirty) continue; |