xserver: Branch 'xwayland-1.12'

Kristian Høgsberg krh at kemper.freedesktop.org
Wed May 22 08:37:44 PDT 2013


 hw/xfree86/xwayland/xwayland-input.c   |   19 +++++++++++++++----
 hw/xfree86/xwayland/xwayland-private.h |    3 +++
 2 files changed, 18 insertions(+), 4 deletions(-)

New commits:
commit 80125785c9d6ea697755a6516fec588aa0519e1f
Author: Kristian Høgsberg <krh at bitplanet.net>
Date:   Wed May 22 11:37:15 2013 -0400

    xwayland: Don't throw away scrolling axis fractions

diff --git a/hw/xfree86/xwayland/xwayland-input.c b/hw/xfree86/xwayland/xwayland-input.c
index b6f3331..4a15853 100644
--- a/hw/xfree86/xwayland/xwayland-input.c
+++ b/hw/xfree86/xwayland/xwayland-input.c
@@ -373,12 +373,16 @@ pointer_handle_axis(void *data, struct wl_pointer *pointer,
 		    uint32_t time, uint32_t axis, wl_fixed_t value)
 {
     struct xwl_seat *xwl_seat = data;
-    int index;
-    int val = wl_fixed_to_int(value);
+    int index, count;
+    int i, val;
 
     /* FIXME: Need to do proper smooth scrolling here! */
     switch (axis) {
     case WL_POINTER_AXIS_VERTICAL_SCROLL:
+	xwl_seat->vertical_scroll += value;
+	val = wl_fixed_to_int(xwl_seat->vertical_scroll);
+	xwl_seat->vertical_scroll -= wl_fixed_from_int(val);
+
 	if (val <= -1)
             index = 4;
 	else if (val >= 1)
@@ -387,6 +391,10 @@ pointer_handle_axis(void *data, struct wl_pointer *pointer,
             return;
 	break;
     case WL_POINTER_AXIS_HORIZONTAL_SCROLL:
+	xwl_seat->horizontal_scroll += value;
+	val = wl_fixed_to_int(xwl_seat->horizontal_scroll);
+	xwl_seat->horizontal_scroll -= wl_fixed_from_int(val);
+
 	if (val <= -1)
             index = 6;
 	else if (val >= 1)
@@ -398,8 +406,11 @@ pointer_handle_axis(void *data, struct wl_pointer *pointer,
 	return;
     }
 
-    xf86PostButtonEvent(xwl_seat->pointer, TRUE, index, 1, 0, 0);
-    xf86PostButtonEvent(xwl_seat->pointer, TRUE, index, 0, 0, 0);
+    count = abs(val);
+    for (i = 0; i < count; i++) {
+	xf86PostButtonEvent(xwl_seat->pointer, TRUE, index, 1, 0, 0);
+	xf86PostButtonEvent(xwl_seat->pointer, TRUE, index, 0, 0, 0);
+    }
 }
 
 static const struct wl_pointer_listener pointer_listener = {
diff --git a/hw/xfree86/xwayland/xwayland-private.h b/hw/xfree86/xwayland/xwayland-private.h
index 3bdd1b9..d595bc5 100644
--- a/hw/xfree86/xwayland/xwayland-private.h
+++ b/hw/xfree86/xwayland/xwayland-private.h
@@ -100,6 +100,9 @@ struct xwl_seat {
     struct xorg_list		 link;
     CursorPtr                    x_cursor;
 
+    wl_fixed_t			 horizontal_scroll;
+    wl_fixed_t			 vertical_scroll;
+
     size_t			 keymap_size;
     char			*keymap;
 


More information about the xorg-commit mailing list