From 5fe57787faa2ea4f2f57b25455d200bf924206d6 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Mon, 26 May 2008 17:23:34 +0930 Subject: [PATCH] dix: store the absolute values in the motion history. The core protocol requires absolute values and it's a bit hard to get them if we only have relative ones in the history. Switch the motion history to absolute, and if we really need the relative values, we can probably generated them from the abs. ones in the future. --- Xi/gtmotion.c | 2 +- dix/getevents.c | 5 +++-- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Xi/gtmotion.c b/Xi/gtmotion.c index 7cc5c2670..ce1312e90 100644 --- a/Xi/gtmotion.c +++ b/Xi/gtmotion.c @@ -119,7 +119,7 @@ ProcXGetDeviceMotionEvents(ClientPtr client) rep.sequenceNumber = client->sequence; rep.nEvents = 0; rep.axes = axes; - rep.mode = v->mode & DeviceMode; + rep.mode = Absolute; /* XXX we don't do relative at the moment */ rep.length = 0; start = ClientTimeToServerTime(stuff->start); stop = ClientTimeToServerTime(stuff->stop); diff --git a/dix/getevents.c b/dix/getevents.c index 643e97763..b5657a86e 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -1003,10 +1003,11 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons, y = rescaleValuatorAxis(pDev->last.valuators[1], NULL, pDev->valuator->axes + 1, scr->height); - updateMotionHistory(pDev, ms, first_valuator, num_valuators, valuators); + updateMotionHistory(pDev, ms, first_valuator, num_valuators, + &pDev->last.valuators[first_valuator]); if (master) updateMotionHistory(master, ms, first_valuator, num_valuators, - valuators); + &pDev->last.valuators[first_valuator]); /* Update the valuators with the true value sent to the client*/ if(v0) *v0 = x;