summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Xi/exevents.c11
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 |