The branch stable/13 has been updated by wulf: URL: https://cgit.FreeBSD.org/src/commit/?id=66292e70e84d01f24d8d571e14f31f8793ce8d89
commit 66292e70e84d01f24d8d571e14f31f8793ce8d89 Author: Niko Sonack <nson...@outlook.com> AuthorDate: 2024-07-02 19:27:25 +0000 Commit: Vladimir Kondratyev <w...@freebsd.org> CommitDate: 2024-09-19 21:44:02 +0000 ums(4): fix incorrect mouse button reporting via evdev when ums driver receives non-mouse HID report. This results in unexpected button release event. Reuse existing sysmouse logic to keep button pressed. Reviewed by: imp, wulf MFC after: 1 week Differential revision: https://reviews.freebsd.org/D45838 (cherry picked from commit d6888e211b07be79dd8de3145ac41b365f482ae8) --- sys/dev/usb/input/ums.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/dev/usb/input/ums.c b/sys/dev/usb/input/ums.c index d8dc2e8f19c3..68a5a33e5e5c 100644 --- a/sys/dev/usb/input/ums.c +++ b/sys/dev/usb/input/ums.c @@ -320,11 +320,12 @@ ums_intr_callback(struct usb_xfer *xfer, usb_error_t error) if (++info != &sc->sc_info[UMS_INFO_MAX]) goto repeat; + /* keep old button value(s) for non-detected buttons */ + buttons |= sc->sc_status.button & ~buttons_found; + #ifdef EVDEV_SUPPORT buttons_reported = buttons; #endif - /* keep old button value(s) for non-detected buttons */ - buttons |= sc->sc_status.button & ~buttons_found; if (dx || dy || dz || dt || dw || (buttons != sc->sc_status.button)) {