From 9d4d3a8ee4f74bcbac762d19f6867ca54b189209 Mon Sep 17 00:00:00 2001 From: =?utf-8?q?Magnus=20Vigerl=C3=B6f?= Date: Thu, 10 Jan 2008 23:44:29 +0100 Subject: [PATCH] dix: Move motion history update until after screen crossing and clipping Cross screen and clip the coordinates before updating the motion history so that it will have the same contents as the events that are reported. Also update only the motion history for motion events. --- dix/getevents.c | 19 ++++++++++--------- 1 files changed, 10 insertions(+), 9 deletions(-) diff --git a/dix/getevents.c b/dix/getevents.c index f8f93ce..bbcc499 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -660,15 +660,6 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons, } } - /* Drop x and y back into the valuators list, if they were originally - * present. */ - if (first_valuator == 0 && num_valuators >= 1) - valuators[0] = x; - if (first_valuator <= 1 && num_valuators >= (2 - first_valuator)) - valuators[1 - first_valuator] = y; - - updateMotionHistory(pDev, ms, first_valuator, num_valuators, valuators); - pDev->valuator->lastx = x; pDev->valuator->lasty = y; /* Convert the dev coord back to screen coord if we're @@ -709,6 +700,16 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons, } } + /* Drop x and y back into the valuators list, if they were originally + * present. */ + if (first_valuator == 0 && num_valuators >= 1) + valuators[0] = pDev->valuator->lastx; + if (first_valuator <= 1 && num_valuators >= (2 - first_valuator)) + valuators[1 - first_valuator] = pDev->valuator->lasty; + + if (type == MotionNotify) + updateMotionHistory(pDev, ms, first_valuator, num_valuators, valuators); + /* for some reason inputInfo.pointer does not have coreEvents set */ if (coreOnly || pDev->coreEvents) { events->u.u.type = type; -- 1.5.2.5