From 5744f4250cea3c76e5c1aa8490def4d5a31252a2 Mon Sep 17 00:00:00 2001 From: Peter Hutterer Date: Wed, 25 Mar 2009 13:08:27 +1000 Subject: [PATCH] dix: ignore non-pointer events in XineramaCheckMotion (#20557) X.Org Bug 20557 Signed-off-by: Peter Hutterer --- dix/events.c | 24 ++++++++++++++++++++++++ 1 files changed, 24 insertions(+), 0 deletions(-) diff --git a/dix/events.c b/dix/events.c index 6743cae..d4a89cf 100644 --- a/dix/events.c +++ b/dix/events.c @@ -618,6 +618,7 @@ XineramaCheckVirtualMotion( static Bool XineramaCheckMotion(xEvent *xE, DeviceIntPtr pDev) { + INT16 *rootX, *rootY; WindowPtr prevSpriteWin; SpritePtr pSprite = pDev->spriteInfo->sprite; @@ -625,6 +626,29 @@ XineramaCheckMotion(xEvent *xE, DeviceIntPtr pDev) if (xE && !syncEvents.playingEvents) { + /* GetPointerEvents() guarantees that pointer events have the correct + rootX/Y set already. */ + switch(xE->u.u.type) + { + case ButtonPress: + case ButtonRelease: + case MotionNotify: + rootX = &XE_KBPTR.rootX; + rootY = &XE_KBPTR.rootY; + break; + default: + if (xE->u.u.type == DeviceButtonPress || + xE->u.u.type == DeviceButtonRelease || + xE->u.u.type == DeviceMotionNotify) + { + rootX = &((deviceKeyButtonPointer*)xE)->root_x; + rootY = &((deviceKeyButtonPointer*)xE)->root_y; + break; + } + /* all other events return FALSE */ + return FALSE; + } + /* Motion events entering DIX get translated to Screen 0 coordinates. Replayed events have already been translated since they've entered DIX before */ -- 1.6.0.6