[PATCH evdev 3/8] Use last_mt_vals_slot() instead of directly using pEvdev->cur_slot

Benjamin Tissoires benjamin.tissoires at gmail.com
Wed Jan 9 10:21:17 PST 2013


Everywhere else in the code, pEvdev->cur_slot is never used directly,
but through the function last_mt_vals_slot which standardize it.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires at gmail.com>
---
 src/evdev.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index 93758fd..9930f4e 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -129,6 +129,12 @@ static void EvdevInitButtonLabels(EvdevPtr pEvdev, int natoms, Atom *atoms);
 static void EvdevInitProperty(DeviceIntPtr dev);
 static int EvdevSetProperty(DeviceIntPtr dev, Atom atom,
                             XIPropertyValuePtr val, BOOL checkonly);
+
+#if MULTITOUCH
+static int num_slots(EvdevPtr pEvdev);
+static int last_mt_vals_slot(EvdevPtr pEvdev);
+#endif /* MULTITOUCH */
+
 static Atom prop_product_id;
 static Atom prop_invert;
 static Atom prop_calibration;
@@ -729,8 +735,9 @@ EvdevProcessTouch(InputInfoPtr pInfo)
 {
     EvdevPtr pEvdev = pInfo->private;
     int type;
+    int slot_index = last_mt_vals_slot(pEvdev);
 
-    if (pEvdev->cur_slot < 0 || !pEvdev->mt_mask)
+    if (slot_index < 0 || !pEvdev->mt_mask)
         return;
 
     /* If the ABS_MT_SLOT is the first event we get after EV_SYN, skip this */
@@ -745,7 +752,7 @@ EvdevProcessTouch(InputInfoPtr pInfo)
         type = XI_TouchUpdate;
 
 
-    EvdevQueueTouchEvent(pInfo, pEvdev->cur_slot, pEvdev->mt_mask, type);
+    EvdevQueueTouchEvent(pInfo, slot_index, pEvdev->mt_mask, type);
 
     pEvdev->slot_state = SLOTSTATE_EMPTY;
 
-- 
1.8.0.2



More information about the xorg-devel mailing list