aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/dix/ptrveloc.c
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-05-05 09:43:03 +0000
committermarha <marha@users.sourceforge.net>2010-05-05 09:43:03 +0000
commit0874ae23a16946781dd517cfdb011c691ad0b581 (patch)
tree8de31864935e96a5e59b9fe6ceb12390bbc474cd /xorg-server/dix/ptrveloc.c
parentd059ebdcb012228102f0b64f8cddf9464d5b625a (diff)
downloadvcxsrv-0874ae23a16946781dd517cfdb011c691ad0b581.tar.gz
vcxsrv-0874ae23a16946781dd517cfdb011c691ad0b581.tar.bz2
vcxsrv-0874ae23a16946781dd517cfdb011c691ad0b581.zip
svn merge -r571:HEAD "^/branches/released" .
Diffstat (limited to 'xorg-server/dix/ptrveloc.c')
-rw-r--r--xorg-server/dix/ptrveloc.c31
1 files changed, 9 insertions, 22 deletions
diff --git a/xorg-server/dix/ptrveloc.c b/xorg-server/dix/ptrveloc.c
index b9ece2159..ffc1a1d85 100644
--- a/xorg-server/dix/ptrveloc.c
+++ b/xorg-server/dix/ptrveloc.c
@@ -92,8 +92,6 @@ GetAccelerationProfile(DeviceVelocityPtr vel, int profile_num);
/* some int which is not a profile number */
#define PROFILE_UNINITIALIZE (-100)
-/* number of properties for predictable acceleration */
-#define NPROPS_PREDICTABLE_ACCEL 4
/**
* Init struct so it should match the average case
@@ -332,26 +330,18 @@ AccelInitScaleProperty(DeviceIntPtr dev, DeviceVelocityPtr vel)
return XIRegisterPropertyHandler(dev, AccelSetScaleProperty, NULL, NULL);
}
-static int AccelPropHandlerPrivateKeyIndex;
-DevPrivateKey AccelPropHandlerPrivateKey = &AccelPropHandlerPrivateKeyIndex;
-
BOOL
InitializePredictableAccelerationProperties(DeviceIntPtr dev)
{
DeviceVelocityPtr vel = GetDevicePredictableAccelData(dev);
- long *prop_handlers;
if(!vel)
return FALSE;
- prop_handlers = xalloc(NPROPS_PREDICTABLE_ACCEL * sizeof(long));
-
- prop_handlers[0] = AccelInitProfileProperty(dev, vel);
- prop_handlers[1] = AccelInitDecelProperty(dev, vel);
- prop_handlers[2] = AccelInitAdaptDecelProperty(dev, vel);
- prop_handlers[3] = AccelInitScaleProperty(dev, vel);
- dixSetPrivate(&dev->devPrivates, AccelPropHandlerPrivateKey,
- prop_handlers);
+ vel->prop_handlers[0] = AccelInitProfileProperty(dev, vel);
+ vel->prop_handlers[1] = AccelInitDecelProperty(dev, vel);
+ vel->prop_handlers[2] = AccelInitAdaptDecelProperty(dev, vel);
+ vel->prop_handlers[3] = AccelInitScaleProperty(dev, vel);
return TRUE;
}
@@ -359,8 +349,8 @@ InitializePredictableAccelerationProperties(DeviceIntPtr dev)
BOOL
DeletePredictableAccelerationProperties(DeviceIntPtr dev)
{
+ DeviceVelocityPtr vel;
Atom prop;
- long *prop_handlers;
int i;
prop = XIGetKnownProperty(ACCEL_PROP_VELOCITY_SCALING);
@@ -372,13 +362,10 @@ DeletePredictableAccelerationProperties(DeviceIntPtr dev)
prop = XIGetKnownProperty(ACCEL_PROP_PROFILE_NUMBER);
XIDeleteDeviceProperty(dev, prop, FALSE);
- prop_handlers = dixLookupPrivate(&dev->devPrivates,
- AccelPropHandlerPrivateKey);
- dixSetPrivate(&dev->devPrivates, AccelPropHandlerPrivateKey, NULL);
-
- for (i = 0; prop_handlers && i < NPROPS_PREDICTABLE_ACCEL; i++)
- XIUnregisterPropertyHandler(dev, prop_handlers[i]);
- xfree(prop_handlers);
+ vel = GetDevicePredictableAccelData(dev);
+ for (i = 0; vel && i < NPROPS_PREDICTABLE_ACCEL; i++)
+ if (vel->prop_handlers[i])
+ XIUnregisterPropertyHandler(dev, vel->prop_handlers[i]);
return TRUE;
}