[PATCH evdev 1/3] Drop ABS_MT_SLOT minimum - the kernel guarantees a minimum of 0

Peter Hutterer peter.hutterer at who-t.net
Thu Oct 3 23:19:55 PDT 2013


Signed-off-by: Peter Hutterer <peter.hutterer at who-t.net>
---
 src/evdev.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/src/evdev.c b/src/evdev.c
index b97b841..a738cfa 100644
--- a/src/evdev.c
+++ b/src/evdev.c
@@ -762,8 +762,7 @@ EvdevProcessTouch(InputInfoPtr pInfo)
 static int
 num_slots(EvdevPtr pEvdev)
 {
-    int value = pEvdev->absinfo[ABS_MT_SLOT].maximum -
-                pEvdev->absinfo[ABS_MT_SLOT].minimum + 1;
+    int value = pEvdev->absinfo[ABS_MT_SLOT].maximum + 1;
 
     /* If we don't know how many slots there are, assume at least 10 */
     return value > 1 ? value : 10;
@@ -772,7 +771,7 @@ num_slots(EvdevPtr pEvdev)
 static int
 last_mt_vals_slot(EvdevPtr pEvdev)
 {
-    int value = pEvdev->cur_slot - pEvdev->absinfo[ABS_MT_SLOT].minimum;
+    int value = pEvdev->cur_slot;
 
     return value < num_slots(pEvdev) ? value : -1;
 }
-- 
1.8.3.1



More information about the xorg-devel mailing list