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.
This commit is contained in:
parent
5b38eb69cd
commit
b9e180e632
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
|
|
@ -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;
|
||||
|
||||
|
|
|
@ -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:
|
||||
|
|
|
@ -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;
|
||||
|
|
Loading…
Reference in New Issue
Block a user