Input: Pass co-ordinates by reference to transformAbsolute
With the upcoming XI 2.1 touch work, the co-ordinate values will need to be passed by reference, rather than modified in-place. Signed-off-by: Chase Douglas <chase.douglas@canonical.com> Reviewed-by: Daniel Stone <daniel@fooishbar.org>
This commit is contained in:
parent
a14a0c7113
commit
65b54548dc
|
@ -1051,23 +1051,14 @@ FreeEventList(EventListPtr list, int num_events)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask)
|
transformAbsolute(DeviceIntPtr dev, ValuatorMask *mask, int *x, int *y)
|
||||||
{
|
{
|
||||||
struct pixman_f_vector p;
|
struct pixman_f_vector p = {.v = {*x, *y, 1}};
|
||||||
|
|
||||||
/* p' = M * p in homogeneous coordinates */
|
|
||||||
p.v[0] = (valuator_mask_isset(mask, 0) ? valuator_mask_get(mask, 0) :
|
|
||||||
dev->last.valuators[0]);
|
|
||||||
p.v[1] = (valuator_mask_isset(mask, 1) ? valuator_mask_get(mask, 1) :
|
|
||||||
dev->last.valuators[1]);
|
|
||||||
p.v[2] = 1.0;
|
|
||||||
|
|
||||||
pixman_f_transform_point(&dev->transform, &p);
|
pixman_f_transform_point(&dev->transform, &p);
|
||||||
|
|
||||||
if (lround(p.v[0]) != dev->last.valuators[0])
|
*x = lround(p.v[0]);
|
||||||
valuator_mask_set(mask, 0, lround(p.v[0]));
|
*y = lround(p.v[1]);
|
||||||
if (lround(p.v[1]) != dev->last.valuators[1])
|
|
||||||
valuator_mask_set(mask, 1, lround(p.v[1]));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -1158,7 +1149,16 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, int type, int buttons,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
transformAbsolute(pDev, &mask);
|
x = (valuator_mask_isset(&mask, 0) ? valuator_mask_get(&mask, 0) :
|
||||||
|
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