When mouse reporting feature is turned on (control sequence ^[[?1000h), syscons sends valid mouse coordinates only for ttyv0. Applications running on other ttys always (erroneously) get mouse coordinates from the first tty, not from tty they actually run. Steps to reproduce: 1. On ttyv0, run any application that uses mouse reporting feature. Make some clicks. The feature works properly. 2. Switch to another ttyv, run the application. The application receives mouse click events, but mouse position reported by syscons to the application does not match with the actual mouse position on the screen. Expected result: Reported mouse position should match with visible mouse position. The bug affects CURRENT as well as 10.0-RELEASE. The patch seems to be trivial.
Created attachment 146855 [details] The patch (patch)
Keyword: patch or patch-ready – in lieu of summary line prefix: [patch] * bulk change for the keyword * summary lines may be edited manually (not in bulk). Keyword descriptions and search interface: <https://bugs.freebsd.org/bugzilla/describekeywords.cgi>
I'm sorry for the apparent lack of attention. (In reply to Vadim Ushakov from comment #1) Still applicable: % git -C /usr/src pull --ff-only freebsd main From https://git.freebsd.org/src * branch main -> FETCH_HEAD Already up to date. % git -C /usr/src/sys apply --check --verbose /tmp/146855.diff Checking patch sys/dev/syscons/scmouse.c... %
A commit in branch main references this bug: URL: https://cgit.FreeBSD.org/src/commit/?id=751c323b829c36ca63a123a02a51f971ca3bd409 commit 751c323b829c36ca63a123a02a51f971ca3bd409 Author: Vadim Ushakov <igeekless@gmail.com> AuthorDate: 2024-01-14 16:22:17 +0000 Commit: Warner Losh <imp@FreeBSD.org> CommitDate: 2024-01-14 16:24:41 +0000 sc: Use current console rather than first console for mouse input When mouse reporting feature is turned on (control sequence ^[[?1000h), syscons sends valid mouse coordinates only for ttyv0. Applications running on other ttys always (erroneously) get mouse coordinates from the first tty, not from tty they actually run. Steps to reproduce: 1. On ttyv0, run any application that uses mouse reporting feature. Make some clicks. The feature works properly. 2. Switch to another ttyv, run the application. The application receives mouse click events, but mouse position reported by syscons to the application does not match with the actual mouse position on the screen. Expected result: Reported mouse position should match with visible mouse position. PR: 193339 Reviewed by: imp sys/dev/syscons/scmouse.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
This patch is good. Everything else uses the current console, except this. Either the sc_mouse_input should use the current console and be passed the base one, or like this patch: it should just pass the current one. Committing.