The branch stable/13 has been updated by wulf:

URL: 
https://cgit.FreeBSD.org/src/commit/?id=f7d9821cdb06604616a695ef2514116e5e0175d4

commit f7d9821cdb06604616a695ef2514116e5e0175d4
Author:     Vladimir Kondratyev <[email protected]>
AuthorDate: 2021-08-24 22:45:16 +0000
Commit:     Vladimir Kondratyev <[email protected]>
CommitDate: 2021-09-07 23:57:11 +0000

    evdev: Send first active rather than 0-th slot state as ST report
    
    (cherry picked from commit fbe17f9017e785dd564ce7fc5553a9136d3a0b03)
---
 sys/dev/evdev/evdev_mt.c | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/sys/dev/evdev/evdev_mt.c b/sys/dev/evdev/evdev_mt.c
index a28b034884ba..0ededf053f36 100644
--- a/sys/dev/evdev/evdev_mt.c
+++ b/sys/dev/evdev/evdev_mt.c
@@ -205,20 +205,21 @@ static void
 evdev_mt_send_st_compat(struct evdev_dev *evdev)
 {
        struct evdev_mt *mt = evdev->ev_mt;
-       int nfingers, i;
+       int nfingers, i, st_slot;
 
        EVDEV_LOCK_ASSERT(evdev);
 
        nfingers = bitcount(mt->touches);
        evdev_send_event(evdev, EV_KEY, BTN_TOUCH, nfingers > 0);
 
-       if ((mt->touches & 1U << 0) != 0)
-               /* Echo 0-th MT-slot as ST-slot */
+       /* Send first active MT-slot state as single touch report */
+       st_slot = ffs(mt->touches) - 1;
+       if (st_slot != -1)
                for (i = 0; i < nitems(evdev_mtstmap); i++)
                        if (bit_test(evdev->ev_abs_flags, evdev_mtstmap[i][1]))
                                evdev_send_event(evdev, EV_ABS,
                                    evdev_mtstmap[i][1],
-                                   evdev_mt_get_value(evdev, 0,
+                                   evdev_mt_get_value(evdev, st_slot,
                                    evdev_mtstmap[i][0]));
 
        /* Touchscreens should not report tool taps */
_______________________________________________
[email protected] mailing list
https://lists.freebsd.org/mailman/listinfo/dev-commits-src-all
To unsubscribe, send any mail to "[email protected]"

Reply via email to