diff options
author | Daniel Stone <daniel@fooishbar.org> | 2008-06-10 18:33:57 +0300 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2008-06-10 18:34:18 +0300 |
commit | 4d59afd613cd7e82255fc83e921300f6bd3a7552 (patch) | |
tree | 744750ca7a0d7f204a19b9c46a05fa8ceb10b751 | |
parent | 7982aaa7f071f9a21ad402da872d5328bd7e51ff (diff) |
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 8259d19f7155d82197ecc2aa16b316376c2dcb12)
-rw-r--r-- | Xi/exevents.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c index 7cf0c50a5..0de5ea8a4 100644 --- a/Xi/exevents.c +++ b/Xi/exevents.c @@ -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 | |