dix: Skip call to clipAxis for relative core-events
Relative events that generates both core and extention events will have its axis cliped and screen changed by miPointerSetPosition when the events are processed. For absolute and non core-generating relative events the axis must be clipped if we shouldn't end up completely outside the defined ranges (if any).
This commit is contained in:
parent
d9e23c4ff1
commit
a0284d577a
|
@ -609,6 +609,10 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons,
|
||||||
y = cp->valuator->lasty;
|
y = cp->valuator->lasty;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/* Clip both x and y to the defined limits (usually co-ord space limit). */
|
||||||
|
clipAxis(pDev, 0, &x);
|
||||||
|
clipAxis(pDev, 1, &y);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
if (flags & POINTER_ACCELERATE)
|
if (flags & POINTER_ACCELERATE)
|
||||||
|
@ -647,22 +651,22 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons,
|
||||||
y += valuators[1 - first_valuator];
|
y += valuators[1 - first_valuator];
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
|
x = pDev->valuator->lastx;
|
||||||
|
y = pDev->valuator->lasty;
|
||||||
if (first_valuator == 0 && num_valuators >= 1)
|
if (first_valuator == 0 && num_valuators >= 1)
|
||||||
x = pDev->valuator->lastx + valuators[0];
|
x += valuators[0];
|
||||||
else
|
|
||||||
x = pDev->valuator->lastx;
|
|
||||||
|
|
||||||
if (first_valuator <= 1 && num_valuators >= (2 - first_valuator))
|
if (first_valuator <= 1 && num_valuators >= (2 - first_valuator))
|
||||||
y = pDev->valuator->lasty + valuators[1 - first_valuator];
|
y += valuators[1 - first_valuator];
|
||||||
else
|
|
||||||
y = pDev->valuator->lasty;
|
if(!coreOnly) {
|
||||||
|
/* Since we're not sending core-events we must clip both x and y
|
||||||
|
* to the defined limits so we don't run outside the box. */
|
||||||
|
clipAxis(pDev, 0, &x);
|
||||||
|
clipAxis(pDev, 1, &y);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Clip both x and y to the defined limits (usually co-ord space limit). */
|
|
||||||
clipAxis(pDev, 0, &x);
|
|
||||||
clipAxis(pDev, 1, &y);
|
|
||||||
|
|
||||||
/* Drop x and y back into the valuators list, if they were originally
|
/* Drop x and y back into the valuators list, if they were originally
|
||||||
* present. */
|
* present. */
|
||||||
if (first_valuator == 0 && num_valuators >= 1)
|
if (first_valuator == 0 && num_valuators >= 1)
|
||||||
|
@ -695,6 +699,24 @@ GetPointerEvents(xEvent *events, DeviceIntPtr pDev, int type, int buttons,
|
||||||
miPointerSetPosition(pDev, &x, &y, ms);
|
miPointerSetPosition(pDev, &x, &y, ms);
|
||||||
|
|
||||||
if (pDev->coreEvents) {
|
if (pDev->coreEvents) {
|
||||||
|
/* miPointerSetPosition may have changed screen */
|
||||||
|
scr = miPointerGetScreen(pDev);
|
||||||
|
if(x != cp->valuator->lastx) {
|
||||||
|
int min = pDev->valuator->axes[0].min_value;
|
||||||
|
int max = pDev->valuator->axes[0].max_value;
|
||||||
|
cp->valuator->lastx = pDev->valuator->lastx = x;
|
||||||
|
if(min < max)
|
||||||
|
pDev->valuator->lastx = (int)((float)(x)*(max-min+1)/scr->width)+min;
|
||||||
|
}
|
||||||
|
if(y != cp->valuator->lasty) {
|
||||||
|
int min = pDev->valuator->axes[1].min_value;
|
||||||
|
int max = pDev->valuator->axes[1].max_value;
|
||||||
|
cp->valuator->lasty = pDev->valuator->lasty = y;
|
||||||
|
if(min < max)
|
||||||
|
pDev->valuator->lasty = (int)((float)(y)*(max-min+1)/scr->height)+min;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
else if (coreOnly) {
|
||||||
cp->valuator->lastx = x;
|
cp->valuator->lastx = x;
|
||||||
cp->valuator->lasty = y;
|
cp->valuator->lasty = y;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user