summaryrefslogtreecommitdiff
path: root/src/properties.c
diff options
context:
space:
mode:
authorPatrick Curran <pjcurran@wisc.edu>2010-07-23 17:28:01 -0500
committerPeter Hutterer <peter.hutterer@who-t.net>2010-08-20 11:08:47 +1000
commit56655fd15f676fea143f3963e23b464b275b2e77 (patch)
tree133b0dc1342a1579f2b81420801290c67024d6a9 /src/properties.c
parenta6ca4d2523904b7ce49edc29ba408979bdf0d45e (diff)
Added "friction physics" so coasting can stop on its own.
When you are coasting (but not corner coasting) you might want the scrolling to slow down and stop on its own. This also lets you start coasting while using a two finger scroll. Signed-off-by: Patrick Curran <pjcurran@wisc.edu> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Tested-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src/properties.c')
-rw-r--r--src/properties.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/src/properties.c b/src/properties.c
index b17089c..ee9a5a6 100644
--- a/src/properties.c
+++ b/src/properties.c
@@ -243,7 +243,8 @@ InitDeviceProperties(LocalDevicePtr local)
prop_palm_dim = InitAtom(local->dev, SYNAPTICS_PROP_PALM_DIMENSIONS, 32, 2, values);
fvalues[0] = para->coasting_speed;
- prop_coastspeed = InitFloatAtom(local->dev, SYNAPTICS_PROP_COASTING_SPEED, 1, fvalues);
+ fvalues[1] = para->coasting_friction;
+ prop_coastspeed = InitFloatAtom(local->dev, SYNAPTICS_PROP_COASTING_SPEED, 2, fvalues);
values[0] = para->press_motion_min_z;
values[1] = para->press_motion_max_z;
@@ -600,14 +601,14 @@ SetProperty(DeviceIntPtr dev, Atom property, XIPropertyValuePtr prop,
para->palm_min_z = dim[1];
} else if (property == prop_coastspeed)
{
- float speed;
+ float *coast_speeds;
- if (prop->size != 1 || prop->format != 32 || prop->type != float_type)
+ if (prop->size != 2 || prop->format != 32 || prop->type != float_type)
return BadMatch;
- speed = *(float*)prop->data;
- para->coasting_speed = speed;
-
+ coast_speeds = (float*)prop->data;
+ para->coasting_speed = coast_speeds[0];
+ para->coasting_friction = coast_speeds[1];
} else if (property == prop_pressuremotion)
{
float *press;