Xi: event_{x,y} should refer to the extended device (bug #16289)

ProcessOtherEvents was unconditionally stomping the root_{x,y}
co-ordinates provided by GetPointerEvents with those of the core
pointer, meaning that both root_{x,y} and event_{x,y} reported to
clients would reflect the sprite's position, not the position reported
by the device that generated the DeviceMotionNotify or the
DeviceButton{Press,Release} event in the first place.

For key events we still take the sprite's co-ords, as we're delivering
to the focus, which is the (VCP) sprite.

Not cherry-picked from master as MPX fixes this anyway, by taking the
co-ords of the sprite the device moves (be it visible or no).
(cherry picked from commit 8259d19f71)
This commit is contained in:
Daniel Stone 2008-06-10 18:33:57 +03:00
parent 7982aaa7f0
commit 4d59afd613

View File

@ -123,9 +123,14 @@ ProcessOtherEvent(xEventPtr xE, DeviceIntPtr other, int count)
deviceValuator *xV = (deviceValuator *) xE;
if (xE->u.u.type != DeviceValuator) {
GetSpritePosition(&rootX, &rootY);
xE->u.keyButtonPointer.rootX = rootX;
xE->u.keyButtonPointer.rootY = rootY;
/* Other types already have root{X,Y} filled in. */
if (xE->u.u.type == DeviceKeyPress ||
xE->u.u.type == DeviceKeyRelease) {
GetSpritePosition(&rootX, &rootY);
xE->u.keyButtonPointer.rootX = rootX;
xE->u.keyButtonPointer.rootY = rootY;
}
key = xE->u.u.detail;
NoticeEventTime(xE);
xE->u.keyButtonPointer.state = inputInfo.keyboard->key->state |