diff options
author | Simon Thum <simon.thum@gmx.de> | 2010-07-18 12:31:26 +0200 |
---|---|---|
committer | Peter Hutterer <peter.hutterer@who-t.net> | 2010-09-01 15:26:51 +1000 |
commit | a46d2bb344e822bbd9d69cb59829b85f9d8f0213 (patch) | |
tree | 6d0098051895d1eca23d87c59345f5121b4721fa | |
parent | e930710ae5579752785d6b96ace4b44bf0199a6e (diff) |
xfree86: Fix xf86 backend-specific input initialization
Instead of shoving it in rather unrelated places, move acceleration init
into xf86NewInputDevice.
Caveat: It's not clear atm how relevant other callers of ActivateDevice
(like OpenDevice) actually are.
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>
Reviewed-by: Adam Jackson <ajax@redhat.com>
Reviewed-by: Daniel Stone <daniel@fooishbar.org>
-rw-r--r-- | hw/xfree86/common/xf86Xinput.c | 27 |
1 files changed, 24 insertions, 3 deletions
diff --git a/hw/xfree86/common/xf86Xinput.c b/hw/xfree86/common/xf86Xinput.c index aae9fe2d8..1bd008233 100644 --- a/hw/xfree86/common/xf86Xinput.c +++ b/hw/xfree86/common/xf86Xinput.c @@ -92,6 +92,9 @@ EventListPtr xf86Events = NULL; +static int +xf86InputDevicePostInit(DeviceIntPtr dev); + /** * Eval config and modify DeviceVelocityRec accordingly */ @@ -778,6 +781,19 @@ xf86DeleteInput(InputInfoPtr pInp, int flags) free(pInp); } +/* + * Apply backend-specific initialization. Invoked after ActiveteDevice(), + * i.e. after the driver successfully completed DEVICE_INIT and the device + * is advertised. + * @param dev the device + * @return Success or an error code + */ +static int +xf86InputDevicePostInit(DeviceIntPtr dev) { + ApplyAccelerationSettings(dev); + return Success; +} + /** * Create a new input device, activate and enable it. * @@ -847,6 +863,14 @@ xf86NewInputDevice(IDevPtr idev, DeviceIntPtr *pdev, BOOL enable) goto unwind; } + rval = xf86InputDevicePostInit(dev); + if (rval != Success) + { + xf86Msg(X_ERROR, "Couldn't post-init device \"%s\"\n", idev->identifier); + RemoveDevice(dev, TRUE); + goto unwind; + } + /* Enable it if it's properly initialised and we're currently in the VT */ if (enable && dev->inited && dev->startup && xf86Screens[0]->vtSema) { @@ -1357,9 +1381,6 @@ xf86InitValuatorDefaults(DeviceIntPtr dev, int axnum) dev->valuator->axisVal[1] = screenInfo.screens[0]->height / 2; dev->last.valuators[1] = dev->valuator->axisVal[1]; } - - if(axnum == 0) /* to prevent double invocation */ - ApplyAccelerationSettings(dev); } |