summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorChris Bagwell <chris@cnpbagwell.com>2010-07-01 20:09:43 -0500
committerPeter Hutterer <peter.hutterer@who-t.net>2010-07-21 14:45:03 +1000
commitffa6dc2809734a6aaa690e9133d6761480603a68 (patch)
treec9faa89715a84e40b91d20054528ff216d1abc03 /src
parente2a247a76e21d9c0be7d537dbfc18df9f3b812fa (diff)
Default to 2-finger emulation when HW supports it
Ideally, emulating 2-fingers should just work on hardware were it can be supported. This patch is to do that. Currently, emulateTwoFingerMinW defaults to 7. Most kernel drivers do not support reporting finger width and so can't get above MinW of 7. Synaptics devices hardcode width value to 5 when hardware doesn't support width and 7 is a good threshold to detect 2 fingers on hardware that does. bcm7954 are only other devices that report width and they support reporting DOUBLETAP and wouldn't need emulation anyways. emulateTwoFingerMinZ defaulted to a really high value so never let Synaptics devices to emulate 2-fingers by default. Changed default to a low value (same as FingerHigh) when hardware doesn't support DOUBLETAP and supports width so emulations will now work by default in all the right cases. I'm working to get kernel to stop reporting ABS_TOOL_WIDTH unless hardware really supports it. If that would have been behavior in first place then we could also default to 2-finger scrolling as well. Since its not reliable, we should continue defaulting to side scrolling. Config GUI's will want to now allow switching between 2-finger and edge scrolling when new property indicates width is supported. GUI's should also update the above MinZ and MinW's to values similar to our defaults. Signed-off-by: Chris Bagwell <chris@cnpbagwell.com> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'src')
-rw-r--r--src/synaptics.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/synaptics.c b/src/synaptics.c
index 6883a06..aa14f76 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -463,13 +463,18 @@ static void set_default_parameters(LocalDevicePtr local)
fingerLow = priv->minp + range * (25.0/256);
fingerHigh = priv->minp + range * (30.0/256);
fingerPress = priv->minp + range * 1.000;
- emulateTwoFingerMinZ = priv->minp + range * (282.0/256);
edgeMotionMinZ = priv->minp + range * (30.0/256);
edgeMotionMaxZ = priv->minp + range * (160.0/256);
pressureMotionMinZ = priv->minp + range * (30.0/256);
pressureMotionMaxZ = priv->minp + range * (160.0/256);
palmMinZ = priv->minp + range * (200.0/256);
+ /* Enable emulation when hw supports both pressure and width. */
+ if (!priv->has_double && priv->has_width)
+ emulateTwoFingerMinZ = fingerHigh;
+ else
+ emulateTwoFingerMinZ = priv->minp + range * (282.0/256);
+
range = priv->maxw - priv->minw;
/* scaling based on defaults below and a tool width of 16 */