[PULL] hw/xwin fixes + a warning fix
Colin Harrison
colin.harrison at virgin.net
Thu Jan 26 15:22:42 PST 2012
Hi,
Looking into it further the code at the end of miPointerSetPosition() maybe
the cause of this...
/* In the event we actually change screen or we get confined, we just
* drop the float component on the floor
* FIXME: only drop remainder for ConstrainCursorHarder, not for screen
* crossings */
if (x != trunc(*screenx))
*screenx = x;
if (y != trunc(*screeny))
*screeny = y;
this was introduced at the same time the function switched to doubles.
If I revert those traps and then call the function...
void winEnqueueMotion(int x, int y)
{
int valuators[2];
ValuatorMask mask;
double dx = (double)x;
double dy = (double)y;
miPointerSetPosition(g_pwinPointer, POINTER_RELATIVE, &dx, &dy);
x = trunc(dx);
y = trunc(dy);
valuators[0] = x;
valuators[1] = y;
valuator_mask_set_range(&mask, 0, 2, valuators);
QueuePointerEvents(g_pwinPointer, MotionNotify, 0,
POINTER_ABSOLUTE | POINTER_SCREEN, &mask);
}
I now get no problem...I could however do better by just using doubles for x
and y in the hw/xwin function headers and get rid of those hacky casts and
trunc()'s. Will now test that + use of POINTER_RELATIVE looks dodgy!
Thanks,
Colin
More information about the xorg-devel
mailing list