summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2012-05-21 15:14:23 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2012-05-31 14:56:48 +1000
commite3791d01f46d9462029178ff24932060b7a57233 (patch)
tree0c4096a32828e93f86e0cf010a7f941a65708ea1
parent823b2f47645d3fe20112ccd79d73165d91df2220 (diff)
Require the frontend to call FinishPreInit
This is the core's last chance to readjust things based on modified parameters. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
-rw-r--r--src/synaptics-x11.c2
-rw-r--r--src/synaptics.c10
-rw-r--r--src/synaptics.h7
3 files changed, 14 insertions, 5 deletions
diff --git a/src/synaptics-x11.c b/src/synaptics-x11.c
index c30e435..9a15027 100644
--- a/src/synaptics-x11.c
+++ b/src/synaptics-x11.c
@@ -741,7 +741,7 @@ SynapticsPreInit(InputDriverPtr drv, InputInfoPtr pInfo, int flags)
}
SynapticsOverrideDefaults(pInfo, priv);
- CalculateScalingCoeffs(priv);
+ SynapticsFinishPreInit(priv);
xf86ProcessCommonOptions(pInfo, pInfo->options);
diff --git a/src/synaptics.c b/src/synaptics.c
index 2bc46c4..125a31d 100644
--- a/src/synaptics.c
+++ b/src/synaptics.c
@@ -508,8 +508,6 @@ SetDefaultParameters(SynapticsPrivate *priv)
pars->hyst_y = vertHyst;
memset(pars->softbutton_areas, 0, sizeof(pars->softbutton_areas));
-
- CalculateScalingCoeffs(priv);
}
SynapticsPrivate *
@@ -2252,7 +2250,7 @@ ScaleCoordinates(SynapticsPrivate * priv, struct SynapticsHwState *hw)
hw->y = (hw->y - yCenter) * priv->vert_coeff + yCenter;
}
-void
+static void
CalculateScalingCoeffs(SynapticsPrivate * priv)
{
int vertRes = priv->synpara.resolution_vert;
@@ -2271,3 +2269,9 @@ CalculateScalingCoeffs(SynapticsPrivate * priv)
priv->vert_coeff = 1;
}
}
+
+void
+SynapticsFinishPreInit(SynapticsPrivate *priv)
+{
+ CalculateScalingCoeffs(priv);
+}
diff --git a/src/synaptics.h b/src/synaptics.h
index ae61bf9..0ba8ab4 100644
--- a/src/synaptics.h
+++ b/src/synaptics.h
@@ -82,7 +82,12 @@ void SynapticsCloseDevice(SynapticsPrivate *priv);
* Implemented-by: frontend
*/
void SynapticsSetTimer(SynapticsPrivate *priv, unsigned int now, unsigned int delay);
-void CalculateScalingCoeffs(SynapticsPrivate * priv);
+/**
+ * Finish any device-specifi initialization, once the hardware has been
+ * queried and all non-default parameters have been set.
+ * Implemented-by: core
+ */
+void SynapticsFinishPreInit(SynapticsPrivate * priv);
Bool SynapticsQueryHardware(SynapticsPrivate *priv, int fd);
struct SynapticsProtocolOperations*
SynapticsGetDeviceProtocolOps(SynapticsPrivate *priv,