summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2007-07-06 16:41:52 +0930
committerPeter Hutterer <peter@cs.unisa.edu.au>2007-07-10 10:09:37 +0930
commit3312e4dd5e055b2cb445b5d5c617aa7a611eedc1 (patch)
treeb05177b1253696d77d6baec8272d636a80238dbd
parentc1a6841a64576b7e688e9ca0d3e0db8acf52d4ae (diff)
Call CheckMotion for all core events.
We need to do this to update the sprites x/y coordinate before we assemble a button event. Absolute devices may send a buttonEvent with valuators attached. If we don't update the sprite before assembling the event, the valuators are lost and the button press is delivered to the previous position of the device. Doesn't have any effect on relative devices.
-rw-r--r--dix/events.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/dix/events.c b/dix/events.c
index 1bec4fc5b..9a6ab33f6 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3634,6 +3634,12 @@ ProcessPointerEvent (xEvent *xE, DeviceIntPtr mouse, int count)
CallCallbacks(&DeviceEventCallback, (pointer)&eventinfo);
}
}
+ /* We need to call CheckMotion for each event. It doesn't really give us
+ any benefit for relative devices, but absolute devices won't send
+ button events to the right position.
+ */
+ if (!CheckMotion(xE, mouse) && xE->u.u.type == MotionNotify)
+ return;
if (xE->u.u.type != MotionNotify)
{
int key;
@@ -3682,8 +3688,7 @@ ProcessPointerEvent (xEvent *xE, DeviceIntPtr mouse, int count)
FatalError("bogus pointer event from ddx");
}
}
- else if (!CheckMotion(xE, mouse))
- return;
+
if (grab)
DeliverGrabbedEvent(xE, mouse, deactivateGrab, count);
else