From b9e180e632d04bf685ade9e32bd0b20882794486 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Wed, 25 Oct 2006 01:09:19 +0300 Subject: [PATCH] port all users to the new DIX motion history API Port KDrive, Xvfb, and Xnest, as well as the virtual core devices, to the new motion history API. Make GetPointerEvents also update the history. --- dix/devices.c | 5 ++--- dix/getevents.c | 2 ++ hw/kdrive/src/kinput.c | 6 ++---- hw/vfb/InitInput.c | 4 ++-- hw/xnest/Pointer.c | 4 ++-- 5 files changed, 10 insertions(+), 11 deletions(-) diff --git a/dix/devices.c b/dix/devices.c index 86e1e7a252..a5110fffa2 100644 --- a/dix/devices.c +++ b/dix/devices.c @@ -285,10 +285,9 @@ CorePointerProc(DeviceIntPtr pDev, int what) case DEVICE_INIT: for (i = 1; i <= 32; i++) map[i] = i; - /* we don't keep history, for now. */ InitPointerDeviceStruct((DevicePtr)pDev, map, 32, - NULL, (PtrCtrlProcPtr)NoopDDA, - 0, 2); + GetMotionHistory, (PtrCtrlProcPtr)NoopDDA, + GetMotionHistorySize(), 2); pDev->valuator->axisVal[0] = screenInfo.screens[0]->width / 2; pDev->valuator->lastx = pDev->valuator->axisVal[0]; pDev->valuator->axisVal[1] = screenInfo.screens[0]->height / 2; diff --git a/dix/getevents.c b/dix/getevents.c index 8e22ad6a62..0a228cd017 100644 --- a/dix/getevents.c +++ b/dix/getevents.c @@ -591,6 +591,8 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons, if (first_valuator <= 1 && num_valuators >= (2 - first_valuator)) valuators[1 - first_valuator] = y; + updateMotionHistory(pDev, ms, first_valuator, num_valuators, valuators); + if (pDev->coreEvents) { cp->valuator->lastx = x; cp->valuator->lasty = y; diff --git a/hw/kdrive/src/kinput.c b/hw/kdrive/src/kinput.c index 78943e4871..724f724dbe 100644 --- a/hw/kdrive/src/kinput.c +++ b/hw/kdrive/src/kinput.c @@ -445,11 +445,10 @@ KdPointerProc(DeviceIntPtr pDevice, int onoff) } InitPointerDeviceStruct(pDev, pi->map, pi->nButtons, - miPointerGetMotionEvents, + GetMotionHistory, (PtrCtrlProcPtr)NoopDDA, - miPointerGetMotionBufferSize(), pi->nAxes); + GetMotionHistorySize(), pi->nAxes); -#ifdef XINPUT if (pi->inputClass == KD_TOUCHSCREEN) { InitAbsoluteClassDeviceStruct(pDevice); xiclass = AtomFromName(XI_TOUCHSCREEN); @@ -460,7 +459,6 @@ KdPointerProc(DeviceIntPtr pDevice, int onoff) AssignTypeAndName(pi->dixdev, xiclass, pi->name ? pi->name : "Generic KDrive Pointer"); -#endif return Success; diff --git a/hw/vfb/InitInput.c b/hw/vfb/InitInput.c index c0bfb55432..9cb1c02cba 100644 --- a/hw/vfb/InitInput.c +++ b/hw/vfb/InitInput.c @@ -292,8 +292,8 @@ vfbMouseProc(DeviceIntPtr pDevice, int onoff) map[1] = 1; map[2] = 2; map[3] = 3; - InitPointerDeviceStruct(pDev, map, 3, miPointerGetMotionEvents, - (PtrCtrlProcPtr)NoopDDA, miPointerGetMotionBufferSize(), 2); + InitPointerDeviceStruct(pDev, map, 3, GetMotionHistory, + (PtrCtrlProcPtr)NoopDDA, GetMotionHistorySize(), 2); break; case DEVICE_ON: diff --git a/hw/xnest/Pointer.c b/hw/xnest/Pointer.c index b5e45db12c..912b6fa216 100644 --- a/hw/xnest/Pointer.c +++ b/hw/xnest/Pointer.c @@ -57,9 +57,9 @@ xnestPointerProc(DeviceIntPtr pDev, int onoff) for (i = 0; i <= nmap; i++) map[i] = i; /* buttons are already mapped */ InitPointerDeviceStruct(&pDev->public, map, nmap, - miPointerGetMotionEvents, + GetMotionHistory, xnestChangePointerControl, - miPointerGetMotionBufferSize(), 2); + GetMotionHistorySize(), 2); break; case DEVICE_ON: xnestEventMask |= XNEST_POINTER_EVENT_MASK;