<div dir="ltr">Any reason you switched the order of these two if statements around?<br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Fri, May 23, 2014 at 10:06 AM, Hans de Goede <span dir="ltr"><<a href="mailto:hdegoede@redhat.com" target="_blank">hdegoede@redhat.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">We pin scrolling to the initial direction, so a 2 finger scroll starting<br>
in the vertical direction, will from then on only generate vertical scroll<br>
events, and the same for horizontal.<br>
<br>
But if the first 2 finger motion is diagonal, then we go into a diagonal<br>
scrolling mode where we post both horizontal and vertical scrolling events.<br>
<br>
This is inconsistent, if we want to allow both at the same time (which we<br>
don;t), we should always allow both, not only when the first motion is<br>
diagonal.<br>
<br>
This commit fixes things so that if the initial motion is diagonal, we go<br>
into vertical scrolling mode as that is what the user most likely wants.<br>
<br>
Signed-off-by: Hans de Goede <<a href="mailto:hdegoede@redhat.com">hdegoede@redhat.com</a>><br>
---<br>
src/evdev-mt-touchpad.c | 8 +++-----<br>
1 file changed, 3 insertions(+), 5 deletions(-)<br>
<br>
diff --git a/src/evdev-mt-touchpad.c b/src/evdev-mt-touchpad.c<br>
index f28cd13..e7943f6 100644<br>
--- a/src/evdev-mt-touchpad.c<br>
+++ b/src/evdev-mt-touchpad.c<br>
@@ -465,14 +465,12 @@ tp_post_twofinger_scroll(struct tp_dispatch *tp, uint64_t time)<br>
<br>
if (tp->scroll.state == SCROLL_STATE_NONE) {<br>
/* Require at least one px scrolling to start */<br>
- if (dx <= -1.0 || dx >= 1.0) {<br>
- tp->scroll.state = SCROLL_STATE_SCROLLING;<br>
- tp->scroll.direction |= (1 << LIBINPUT_POINTER_AXIS_HORIZONTAL_SCROLL);<br>
- }<br>
-<br>
if (dy <= -1.0 || dy >= 1.0) {<br>
tp->scroll.state = SCROLL_STATE_SCROLLING;<br>
tp->scroll.direction |= (1 << LIBINPUT_POINTER_AXIS_VERTICAL_SCROLL);<br>
+ } else if (dx <= -1.0 || dx >= 1.0) {<br>
+ tp->scroll.state = SCROLL_STATE_SCROLLING;<br>
+ tp->scroll.direction |= (1 << LIBINPUT_POINTER_AXIS_HORIZONTAL_SCROLL);<br>
}<br>
<br>
if (tp->scroll.state == SCROLL_STATE_NONE)<br>
<span class="HOEnZb"><font color="#888888">--<br>
1.9.3<br>
<br>
_______________________________________________<br>
wayland-devel mailing list<br>
<a href="mailto:wayland-devel@lists.freedesktop.org">wayland-devel@lists.freedesktop.org</a><br>
<a href="http://lists.freedesktop.org/mailman/listinfo/wayland-devel" target="_blank">http://lists.freedesktop.org/mailman/listinfo/wayland-devel</a><br>
</font></span></blockquote></div><br><br clear="all"><br>-- <br> Jasper<br>
</div>