No functional changes, just improves readability. This statement had things
added to/removed from it for a few server releases while the input event
queue was revamped. What made sense once is now mainly confusing.

Signed-off-by: Peter Hutterer <[email protected]>
---
 dix/getevents.c |   26 +++++++++++++++++---------
 1 files changed, 17 insertions(+), 9 deletions(-)

diff --git a/dix/getevents.c b/dix/getevents.c
index 25889de..9feb216 100644
--- a/dix/getevents.c
+++ b/dix/getevents.c
@@ -1104,17 +1104,25 @@ GetPointerEvents(EventList *events, DeviceIntPtr pDev, 
int type, int buttons,
     if (!pDev->enabled)
         return 0;
 
-    ms = GetTimeInMillis(); /* before pointer update to help precision */
-
-    if (!scr || !pDev->valuator ||
-        (type != MotionNotify && type != ButtonPress && type != ButtonRelease) 
||
-        (type != MotionNotify && !pDev->button) ||
-        ((type == ButtonPress || type == ButtonRelease) && !buttons))
+    if (!scr || !pDev->valuator)
         return 0;
 
-    if (type == MotionNotify &&
-        (!mask_in || valuator_mask_num_valuators(mask_in) <= 0))
-        return 0;
+    switch (type)
+    {
+        case MotionNotify:
+            if (!mask_in || valuator_mask_num_valuators(mask_in) <= 0)
+                return 0;
+            break;
+        case ButtonPress:
+        case ButtonRelease:
+            if (!pDev->button || !buttons)
+                return 0;
+            break;
+        default:
+            return 0;
+    }
+
+    ms = GetTimeInMillis(); /* before pointer update to help precision */
 
     events = UpdateFromMaster(events, pDev, DEVCHANGE_POINTER_EVENT, 
&num_events);
 
-- 
1.7.3.3

_______________________________________________
[email protected]: X.Org development
Archives: http://lists.x.org/archives/xorg-devel
Info: http://lists.x.org/mailman/listinfo/xorg-devel

Reply via email to