ca7f81
From 24e682d0fcc98d7c3f63fa484cc28285df48b499 Mon Sep 17 00:00:00 2001
ca7f81
From: Peter Hutterer <peter.hutterer@who-t.net>
ca7f81
Date: Wed, 25 Mar 2009 13:08:27 +1000
ca7f81
Subject: [PATCH] dix: ignore non-pointer events in XineramaCheckMotion (#20557)
ca7f81
ca7f81
Note that deviceKeyButtonPointer and keyButtonPointer have the same wire
ca7f81
layout, so we only need to check for event types.
ca7f81
ca7f81
X.Org Bug 20557 <http: bugs.freedesktop.org="" show_bug.cgi?id="20557">
ca7f81
ca7f81
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
ca7f81
---
ca7f81
 dix/events.c |   17 +++++++++++++++++
ca7f81
 1 files changed, 17 insertions(+), 0 deletions(-)
ca7f81
ca7f81
diff --git a/dix/events.c b/dix/events.c
ca7f81
index 6743cae..63b0674 100644
ca7f81
--- a/dix/events.c
ca7f81
+++ b/dix/events.c
ca7f81
@@ -625,6 +625,23 @@ XineramaCheckMotion(xEvent *xE, DeviceIntPtr pDev)
ca7f81
 
ca7f81
     if (xE && !syncEvents.playingEvents)
ca7f81
     {
ca7f81
+        /* GetPointerEvents() guarantees that pointer events have the correct
ca7f81
+           rootX/Y set already. */
ca7f81
+        switch(xE->u.u.type)
ca7f81
+        {
ca7f81
+            case ButtonPress:
ca7f81
+            case ButtonRelease:
ca7f81
+            case MotionNotify:
ca7f81
+                break;
ca7f81
+            default:
ca7f81
+                if (xE->u.u.type == DeviceButtonPress ||
ca7f81
+                        xE->u.u.type == DeviceButtonRelease ||
ca7f81
+                        xE->u.u.type == DeviceMotionNotify)
ca7f81
+                    break;
ca7f81
+                /* all other events return FALSE */
ca7f81
+                return FALSE;
ca7f81
+        }
ca7f81
+
ca7f81
 	/* Motion events entering DIX get translated to Screen 0
ca7f81
 	   coordinates.  Replayed events have already been
ca7f81
 	   translated since they've entered DIX before */
ca7f81
-- 
ca7f81
1.6.0.6
ca7f81