summaryrefslogtreecommitdiff
path: root/src/properties.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2011-10-18 15:46:03 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2011-10-24 16:01:30 +1000
commit2603ad69b997c999404ecc441e0d64ea2cc22018 (patch)
tree38bcb0d42704cd67c850f01cf6b4c0845064e22e /src/properties.c
parent4f46057a33b20df62d919e49a394ab6cb7aa6aa1 (diff)
Use the scroll distances as increment for scrolling valuator axes
XI2.1 allows an 'increment' for each scrolling variable. Use that instead of hiding it away inside the driver. For circular scrolling, the increment is the one of the respective scrolling axis. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/properties.c')
-rw-r--r--src/properties.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/properties.c b/src/properties.c
index 5f11cf2..f15a6fb 100644
--- a/src/properties.c
+++ b/src/properties.c
@@ -425,8 +425,22 @@ SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
return BadMatch;
dist = (INT32*)prop->data;
- para->scroll_dist_vert = dist[0];
- para->scroll_dist_horiz = dist[1];
+ if (para->scroll_dist_vert != dist[0])
+ {
+ para->scroll_dist_vert = dist[0];
+#ifdef HAVE_SMOOTH_SCROLL
+ SetScrollValuator(dev, priv->scroll_axis_vert, SCROLL_TYPE_VERTICAL,
+ para->scroll_dist_vert, 0);
+#endif
+ }
+ if (para->scroll_dist_horiz != dist[1])
+ {
+ para->scroll_dist_horiz = dist[1];
+#ifdef HAVE_SMOOTH_SCROLL
+ SetScrollValuator(dev, priv->scroll_axis_horiz, SCROLL_TYPE_HORIZONTAL,
+ para->scroll_dist_horiz, 0);
+#endif
+ }
} else if (property == prop_scrolledge)
{
CARD8 *edge;