summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSimon Thum <simon.thum@gmx.de>2010-01-06 17:32:24 +0100
committerPeter Hutterer <peter.hutterer@who-t.net>2010-01-11 15:30:03 +1000
commit032f97808c65771a07bac748212cf6457a5d1660 (patch)
tree3ac21259cd14360dfb3c7ddbafaecadb84296911
parent0722c287a4c8a6cdedca9756192547bfcf77ade5 (diff)
xfree86: init pointer feedback controls from options
With InputClass support, it makes more sense to cover all aspects of acceleration in options. Previously, one could only set the default on the command line. Signed-off-by: Simon Thum <simon.thum@gmx.de> Reviewed-by: Peter Hutterer <peter.hutterer@who-t.net> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--hw/xfree86/common/xf86Xinput.c28
-rw-r--r--hw/xfree86/doc/man/xorg.conf.man.pre20
2 files changed, 46 insertions, 2 deletions
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c
index 920b9406f..df774a155 100644
--- a/hw/xfree86/common/xf86Xinput.c
+++ b/hw/xfree86/common/xf86Xinput.c
@@ -196,12 +196,12 @@ ProcessVelocityConfiguration(DeviceIntPtr pDev, char* devname, pointer list,
static void
ApplyAccelerationSettings(DeviceIntPtr dev){
- int scheme;
+ int scheme, i;
DeviceVelocityPtr pVel;
LocalDevicePtr local = (LocalDevicePtr)dev->public.devicePrivate;
char* schemeStr;
- if(dev->valuator){
+ if (dev->valuator && dev->ptrfeed) {
schemeStr = xf86SetStrOption(local->options, "AccelerationScheme", "");
scheme = dev->valuator->accelScheme.number;
@@ -244,6 +244,30 @@ ApplyAccelerationSettings(DeviceIntPtr dev){
pVel);
break;
}
+
+ i = xf86SetIntOption(local->options, "AccelerationNumerator",
+ dev->ptrfeed->ctrl.num);
+ if (i >= 0)
+ dev->ptrfeed->ctrl.num = i;
+
+ i = xf86SetIntOption(local->options, "AccelerationDenominator",
+ dev->ptrfeed->ctrl.den);
+ if (i > 0)
+ dev->ptrfeed->ctrl.den = i;
+
+ i = xf86SetIntOption(local->options, "AccelerationThreshold",
+ dev->ptrfeed->ctrl.threshold);
+ if (i >= 0)
+ dev->ptrfeed->ctrl.threshold = i;
+
+ /* mostly a no-op anyway */
+ (*dev->ptrfeed->CtrlProc)(dev, &dev->ptrfeed->ctrl);
+
+ xf86Msg(X_CONFIG, "%s: (accel) acceleration factor: %.3f\n",
+ local->name, ((float)dev->ptrfeed->ctrl.num)/
+ ((float)dev->ptrfeed->ctrl.den));
+ xf86Msg(X_CONFIG, "%s: (accel) acceleration threshold: %i\n",
+ local->name, dev->ptrfeed->ctrl.threshold);
}
}
diff --git a/hw/xfree86/doc/man/xorg.conf.man.pre b/hw/xfree86/doc/man/xorg.conf.man.pre
index be0c67654..222530b41 100644
--- a/hw/xfree86/doc/man/xorg.conf.man.pre
+++ b/hw/xfree86/doc/man/xorg.conf.man.pre
@@ -959,6 +959,26 @@ Selects the scheme, which is the underlying algorithm.
.B "predictable default algorithm (behaving more predictable)"
.B "lightweight old acceleration code (as specified in the X protocol spec)"
.B "none no acceleration or deceleration"
+.fi
+.RE
+.TP 7
+.BI "Option \*qAccelerationNumerator\*q \*q" integer \*q
+.TP 7
+.BI "Option \*qAccelerationDenominator\*q \*q" integer \*q
+Set numerator and denominator of the acceleration factor. The acceleration
+factor is a rational which, together with threshold, can be used to tweak
+profiles to suit the users needs. The
+.B simple
+and
+.B limited
+profiles use it directly (i.e. they accelerate by the factor), for other
+profiles it should hold that a higher acceleration factor leads to a faster
+pointer. Typically, 1 is unaccelerated and values up to 5 are sensible.
+.TP 7
+.BI "Option \*qAccelerationThreshold\*q \*q" integer \*q
+Set the threshold, which is roughly the velocity (usually device units per 10
+ms) required for acceleration to become effective. The precise effect varies
+with the profile however.
.SH "INPUTCLASS SECTION"
The config file may have multiple