diff options
author | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-05-26 13:53:45 +0930 |
---|---|---|
committer | Peter Hutterer <peter@cs.unisa.edu.au> | 2008-05-26 15:55:20 +0930 |
commit | 0b88510069bdf6d020d73b424f62c2923c0db4a4 (patch) | |
tree | 292a69f6d42f07a1c5e1e4987fd5a01d08b192c4 /Xi | |
parent | d22c25bda450f6f1dfa634f0f72b32c4bec429cd (diff) |
Ensure the motion history is merged for master devices.
Add each event to the master's MH as well as to the SDs. In the MD, store
min/max and the actual value. When retrieving the MH, rescale all coordinates
to the current coordinate range and only post those valuators that are
currently active on the device.
Diffstat (limited to 'Xi')
-rw-r--r-- | Xi/exevents.c | 6 | ||||
-rw-r--r-- | Xi/gtmotion.c | 8 |
2 files changed, 3 insertions, 11 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index f13959fc9..725c57835 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -571,12 +571,8 @@ DeepCopyDeviceClasses(DeviceIntPtr from, DeviceIntPtr to) v = to->valuator; if (!v) FatalError("[Xi] no memory for class shift.\n"); - memcpy(v, from->valuator, sizeof(ValuatorClassRec)); - v->motion = NULL; - AllocateMotionHistory(to); /*XXX should be copied somehow */ - v->first_motion = 0; - v->last_motion = 0; + v->numAxes = from->valuator->numAxes; v->axes = (AxisInfoPtr)&v[1]; memcpy(v->axes, from->valuator->axes, v->numAxes * sizeof(AxisInfo)); diff --git a/Xi/gtmotion.c b/Xi/gtmotion.c index 7994890d3..8b59d67ec 100644 --- a/Xi/gtmotion.c +++ b/Xi/gtmotion.c @@ -132,12 +132,8 @@ ProcXGetDeviceMotionEvents(ClientPtr client) stop = currentTime; num_events = v->numMotionEvents; if (num_events) { - size = sizeof(Time) + (axes * sizeof(INT32)); - tsize = num_events * size; - coords = (INT32 *) xalloc(tsize); - if (!coords) - return BadAlloc; - rep.nEvents = GetMotionHistory(dev, (xTimecoord *) coords,/* XXX */ + size = sizeof(Time) + (axes * sizeof(INT32)); + rep.nEvents = GetMotionHistory(dev, (xTimecoord **) &coords,/* XXX */ start.milliseconds, stop.milliseconds, (ScreenPtr) NULL); } |