From 3312e4dd5e055b2cb445b5d5c617aa7a611eedc1 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Fri, 6 Jul 2007 16:41:52 +0930 Subject: [PATCH] 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. --- dix/events.c | 9 +++++++-- 1 file 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