From 4d59afd613cd7e82255fc83e921300f6bd3a7552 Mon Sep 17 00:00:00 2001 From: Daniel Stone Date: Tue, 10 Jun 2008 18:33:57 +0300 Subject: [PATCH] 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) --- Xi/exevents.c | 11 ++++++++--- 1 file 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 |