dix: don't pass x/y to transformAbsolute
We passed in the mask, but didn't do anything with it. Move the logic to take the axes out of the valuator masks into transformAbsolute. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net> Reviewed-by: Simon Thum <simon.thum@gmx.de>
This commit is contained in:
parent
62f1bf96e1
commit
fe4b818700
|
@ -1052,17 +1052,38 @@ FreeEventList(InternalEvent *list, int num_events)
|
||||||
free(list);
|
free(list);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transform vector x/y according to matrix m and drop the rounded coords
|
||||||
|
* back into x/y.
|
||||||
|
*/
|
||||||
static void
|
static void
|
||||||
transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask, int *x, int *y)
|
transform(struct pixman_f_transform *m, int *x, int *y)
|
||||||
{
|
{
|
||||||
struct pixman_f_vector p = {.v = {*x, *y, 1}};
|
struct pixman_f_vector p = {.v = {*x, *y, 1}};
|
||||||
|
pixman_f_transform_point(m, &p);
|
||||||
pixman_f_transform_point(&dev->transform, &p);
|
|
||||||
|
|
||||||
*x = lround(p.v[0]);
|
*x = lround(p.v[0]);
|
||||||
*y = lround(p.v[1]);
|
*y = lround(p.v[1]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask)
|
||||||
|
{
|
||||||
|
int x, y;
|
||||||
|
|
||||||
|
x = valuator_mask_isset(mask, 0) ? valuator_mask_get(mask, 0) :
|
||||||
|
dev->last.valuators[0];
|
||||||
|
y = valuator_mask_isset(mask, 1) ? valuator_mask_get(mask, 1) :
|
||||||
|
dev->last.valuators[1];
|
||||||
|
|
||||||
|
transform(&dev->transform, &x, &y);
|
||||||
|
|
||||||
|
if (valuator_mask_isset(mask, 0))
|
||||||
|
valuator_mask_set(mask, 0, x);
|
||||||
|
if (valuator_mask_isset(mask, 1))
|
||||||
|
valuator_mask_set(mask, 1, y);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Generate internal events representing this pointer event and enqueue them
|
* Generate internal events representing this pointer event and enqueue them
|
||||||
* on the event queue.
|
* on the event queue.
|
||||||
|
@ -1175,16 +1196,7 @@ GetPointerEvents(InternalEvent *events, DeviceIntPtr pDev, int type, int buttons
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
x = (valuator_mask_isset(&mask, 0) ? valuator_mask_get(&mask, 0) :
|
transformAbsolute(pDev, &mask);
|
||||||
pDev->last.valuators[0]);
|
|
||||||
y = (valuator_mask_isset(&mask, 1) ? valuator_mask_get(&mask, 1) :
|
|
||||||
pDev->last.valuators[1]);
|
|
||||||
transformAbsolute(pDev, &mask, &x, &y);
|
|
||||||
if (valuator_mask_isset(&mask, 0))
|
|
||||||
valuator_mask_set(&mask, 0, x);
|
|
||||||
if (valuator_mask_isset(&mask, 1))
|
|
||||||
valuator_mask_set(&mask, 1, y);
|
|
||||||
|
|
||||||
moveAbsolute(pDev, &x, &y, &mask);
|
moveAbsolute(pDev, &x, &y, &mask);
|
||||||
} else {
|
} else {
|
||||||
if (flags & POINTER_ACCELERATE) {
|
if (flags & POINTER_ACCELERATE) {
|
||||||
|
|
Loading…
Reference in New Issue