[PATCH xserver 4/5] XWayland: Skip unknown scroll values

Tiago Vignatti tiago.vignatti at intel.com
Thu Nov 22 14:22:59 PST 2012


From: Daniel Stone <daniel at fooishbar.org>

We really need to support smooth scrolling properly, but in the meantime
just skip unknown scroll values.

Signed-off-by: Daniel Stone <daniel at fooishbar.org>

Before this patch, a crash was easy to reproduce using two-finger scrolling on
a touchpad based device.

Signed-off-by: Tiago Vignatti <tiago.vignatti at intel.com>
---
 hw/xfree86/xwayland/xwayland-input.c |    3 +++
 1 file changed, 3 insertions(+)

diff --git a/hw/xfree86/xwayland/xwayland-input.c b/hw/xfree86/xwayland/xwayland-input.c
index e547b43..0d38579 100644
--- a/hw/xfree86/xwayland/xwayland-input.c
+++ b/hw/xfree86/xwayland/xwayland-input.c
@@ -372,10 +372,13 @@ pointer_handle_axis(void *data, struct wl_pointer *pointer,
     int index;
     int val = wl_fixed_to_int(value);
 
+    /* FIXME: Need to do proper smooth scrolling here! */
     if (val == 1)
         index = 4;
     else if (val == -1)
         index = 5;
+    else
+        return;
 
     xf86PostButtonEvent(xwl_seat->pointer, TRUE, index, 1, 0, 0);
     xf86PostButtonEvent(xwl_seat->pointer, TRUE, index, 0, 0, 0);
-- 
1.7.9.5



More information about the wayland-devel mailing list