From nobody Sun Jan 14 16:32:40 2024 X-Original-To: dev-commits-src-all@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id 4TCgmT0D2Jz56ZyW; Sun, 14 Jan 2024 16:32:41 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4TCgmS5Vn7z4HH7; Sun, 14 Jan 2024 16:32:40 +0000 (UTC) (envelope-from git@FreeBSD.org) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705249960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=68tAvJxlj2jblFMU4cqxmD86idHUQ+4A7t0BpxZ+Xnk=; b=NWSFDIhy8W4vmA4is/ozqZ3ECdciVr5qno/e2HTS/g1D8lvh2Nqt0Mb8/UZhRfMpBY+zhK DZpmfhYX+bE1Qx4oAMyTRluWSpvOZ42hExied3jDHyFXXzMMS8t8lfhcfFXfQaJXa2DxhO 8dv4wmCYNq4+VcVxmtCApV9AIS7OUwm3OSa85n63pyEo1zCVFfkmYe3a2KAmu+St34mKml YVkOq4A/3DCTlbpWJu0K83fZujyHT6I1rKhoJJ0LYbdwK8Y1bLiJIqlWkOT9+OAOHH2F8W c/Aj36t1JWdnUH7FwbzA7W3eQVMGziylRQPOZQZN0IrRe6EmxFgosFwoS0ReWg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=freebsd.org; s=dkim; t=1705249960; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding; bh=68tAvJxlj2jblFMU4cqxmD86idHUQ+4A7t0BpxZ+Xnk=; b=j9sR20rQtgGX/80fBnm9FK1HPQ1nuyWeFPo5lfs4iaUg7l3NpeefD/05VnEmDdEZMndhMP fF5BBKiCBZPZeOlVv2AvyyW12jWKl+QzB3g5gYwx4ARrSmYHX+IPOnd53DOrEFKg5ZA/Hh WOpBYnAKrhONHC4RIehTXCOe9p8ISwm06ImsPpfXDR4ew8SKZpuW2hQlpAGm2fUKmV9lNY 2Pkh5FvA55u2yXNRuSqFZOnvT16vzchL12UJ6IPIqxT3WvsX2YoDk+S/c5GxmAp1hiaQlN kyWW1c6x95UpaJgCwO/nDKLl0RtTC1UcU1okw67/pH5dZn/4XPLmHtQU/35tYQ== ARC-Authentication-Results: i=1; mx1.freebsd.org; none ARC-Seal: i=1; s=dkim; d=freebsd.org; t=1705249960; a=rsa-sha256; cv=none; b=TW69H3GC1nD28T8cd2yHKo596DqpYp7FDe7tSGOl6dWQAI8zr/Q+Hw+Qma9JGCjwjOItUy zvT16Y7W6dp3NRC7KVkam3316Y7q85s2Yi9WaD8YrYWqdk5zoSKRJZVVMhm2z6mc4CNQFj oPAVKLVeyRAKNf5Nmpe+TD0h3+O1gbs7OQjqSnDeoU1KeYwUunWpXraH2K9R/CMeKWGW8P +2LiavZNRIDDzAWANXVqBD7tKU0+lHQcMGXZToU5td6NMMH8BESZl0yrjLSY6hdgUQ+tfm WSEACbOyuWxZIWuGJk5u9AQeMSJ3Uog9LtIfUlGSwSkctECj/lT8oboptwJP+w== Received: from gitrepo.freebsd.org (gitrepo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:5]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 4TCgmS4Z0QzKyh; Sun, 14 Jan 2024 16:32:40 +0000 (UTC) (envelope-from git@FreeBSD.org) Received: from gitrepo.freebsd.org ([127.0.1.44]) by gitrepo.freebsd.org (8.17.1/8.17.1) with ESMTP id 40EGWexU002942; Sun, 14 Jan 2024 16:32:40 GMT (envelope-from git@gitrepo.freebsd.org) Received: (from git@localhost) by gitrepo.freebsd.org (8.17.1/8.17.1/Submit) id 40EGWe96002939; Sun, 14 Jan 2024 16:32:40 GMT (envelope-from git) Date: Sun, 14 Jan 2024 16:32:40 GMT Message-Id: <202401141632.40EGWe96002939@gitrepo.freebsd.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org From: Warner Losh Subject: git: 751c323b829c - main - sc: Use current console rather than first console for mouse input List-Id: Commit messages for all branches of the src repository List-Archive: https://lists.freebsd.org/archives/dev-commits-src-all List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-dev-commits-src-all@freebsd.org X-BeenThere: dev-commits-src-all@freebsd.org MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit X-Git-Committer: imp X-Git-Repository: src X-Git-Refname: refs/heads/main X-Git-Reftype: branch X-Git-Commit: 751c323b829c36ca63a123a02a51f971ca3bd409 Auto-Submitted: auto-generated The branch main has been updated by imp: URL: https://cgit.FreeBSD.org/src/commit/?id=751c323b829c36ca63a123a02a51f971ca3bd409 commit 751c323b829c36ca63a123a02a51f971ca3bd409 Author: Vadim Ushakov AuthorDate: 2024-01-14 16:22:17 +0000 Commit: Warner Losh 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(-) diff --git a/sys/dev/syscons/scmouse.c b/sys/dev/syscons/scmouse.c index f23f412cc00d..b0c7fcc9d147 100644 --- a/sys/dev/syscons/scmouse.c +++ b/sys/dev/syscons/scmouse.c @@ -798,7 +798,7 @@ sc_mouse_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td) cur_scp->status &= ~MOUSE_HIDDEN; if (cur_scp->mouse_level > 0) { - sc_mouse_input(scp, mouse); + sc_mouse_input(cur_scp, mouse); break; } @@ -859,7 +859,7 @@ sc_mouse_ioctl(struct tty *tp, u_long cmd, caddr_t data, struct thread *td) cur_scp->status &= ~MOUSE_HIDDEN; if (cur_scp->mouse_level > 0) { - sc_mouse_input(scp, mouse); + sc_mouse_input(cur_scp, mouse); break; }