From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#69915: 30.0.50; mouse-autoselect-window has no effect in terminal Date: Sun, 31 Mar 2024 11:58:36 +0300 Message-ID: <86frw6bww3.fsf@gnu.org> References: <86v856hon0.fsf@gnu.org> <00f0925f3a878950933691973fecd536@finder.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="39311"; mail-complaints-to="usenet@ciao.gmane.io" Cc: olaf.rogalsky@gmail.com, 69915@debbugs.gnu.org To: Jared Finder , martin rudalics Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Sun Mar 31 10:59:21 2024 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane-mx.org Original-Received: from lists.gnu.org ([209.51.188.17]) by ciao.gmane.io with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1rqr27-0009xc-Rm for geb-bug-gnu-emacs@m.gmane-mx.org; Sun, 31 Mar 2024 10:59:20 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1rqr1q-0005F0-9W; Sun, 31 Mar 2024 04:59:02 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqr1o-0005EB-3N for bug-gnu-emacs@gnu.org; Sun, 31 Mar 2024 04:59:00 -0400 Original-Received: from debbugs.gnu.org ([2001:470:142:5::43]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1rqr1n-00014p-Rp for bug-gnu-emacs@gnu.org; Sun, 31 Mar 2024 04:58:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1rqr1q-0006KO-7x for bug-gnu-emacs@gnu.org; Sun, 31 Mar 2024 04:59:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Sun, 31 Mar 2024 08:59:02 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 69915 X-GNU-PR-Package: emacs Original-Received: via spool by 69915-submit@debbugs.gnu.org id=B69915.171187553024189 (code B ref 69915); Sun, 31 Mar 2024 08:59:02 +0000 Original-Received: (at 69915) by debbugs.gnu.org; 31 Mar 2024 08:58:50 +0000 Original-Received: from localhost ([127.0.0.1]:46579 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqr1d-0006I3-Fr for submit@debbugs.gnu.org; Sun, 31 Mar 2024 04:58:49 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:39532) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1rqr1b-0006Hc-Cc for 69915@debbugs.gnu.org; Sun, 31 Mar 2024 04:58:48 -0400 Original-Received: from fencepost.gnu.org ([2001:470:142:3::e]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1rqr1S-0000vU-Ro; Sun, 31 Mar 2024 04:58:38 -0400 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=gnu.org; s=fencepost-gnu-org; h=References:Subject:In-Reply-To:To:From:Date: mime-version; bh=4so9+OCQB9GjkNMaM/PFkt+IAySY9Y6selrqFrHQkBE=; b=VxKY1naL8KRD zIqXVW4sUM3G7cGE/xX/ro4QvMXCMBbtYR+oFn7g/qcWafmH0S1/3kuizH5MnbWhhDKN/uIf6K5pY quw9f0YU1Ko3G/YGZThQKDgEJuyyn3sC26hRUssUcragVY8v8TWbysnj/EVrTdwpoaepYPN/ewrju XpqqO8vNrZaA1XK56eEs56oWbXuNm72BIOeffwQflJR6JRwOWo9VfTDv41C4mwMK7RE7rvrlunlVq aM1d4+4xnr65VNcG7gsbC8fMft+ZF/+w98QuHUI16jsJqRNrxYpxGkiRZJiDU7WlgSPfOqQQuSHI4 vaefvM+xa+Mmv4bhgLiM7w==; In-Reply-To: <00f0925f3a878950933691973fecd536@finder.org> (message from Jared Finder on Thu, 28 Mar 2024 07:41:28 -0700) X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-BeenThere: bug-gnu-emacs@gnu.org List-Id: "Bug reports for GNU Emacs, the Swiss army knife of text editors" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Original-Sender: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Xref: news.gmane.io gmane.emacs.bugs:282422 Archived-At: > Date: Thu, 28 Mar 2024 07:41:28 -0700 > From: Jared Finder > Cc: olaf.rogalsky@gmail.com, 69915@debbugs.gnu.org > > On 2024-03-27 23:11, Eli Zaretskii wrote: > >> Date: Wed, 27 Mar 2024 14:47:27 -0700 > >> From: Jared Finder > >> Cc: eliz@gnu.org, 69915@debbugs.gnu.org > >> > >> > On the other hand, looking at msdos.c, there is no test against > >> > the minibuffer. I believed, that the selection of the minibuffer > >> > is taken care of at +10638 of window.el. In my tests the patch > >> > behaves exactly like the documentation, quote: "Mouse > >> > auto-selection selects the minibuffer window only if it is active, > >> > and never deselects the active minibuffer window." I added the > >> > test, but commented it out. > >> > >> I'm not sure what the right way to proceed here is then. Eli, can you > >> give advice? > >> > >> Looking at different OS files that handle mouse_autoselect_window, I > >> see > >> the following state for checks if the selected window is a minibuffer > >> with MINI_WINDOW_P: > >> > >> pgtkterm.c: checks > >> w32term.c: does NOT check > >> w32inevt.c: does NOT check > >> nsterm.m: checks > >> xterm.c: checks > >> msdos.c: does NOT check > >> haikuterm.c: checks > >> androidterm.c: checks > >> term.c: no support for mouse-autoselect-window. :( > >> > >> My gut is to assume that the X and GTK behavior is most likely to be > >> better tested and more correct, but I defer to Eli here. > > > > I tend to agree. But, just to be sure, can you or Olaf describe the > > exact issue and how it could happen, and perhaps show a recipe to try > > reproducing it? I'd like to take a closer look at the relevant code. > > The intended behavior is that is even with mouse-autoselect-window set, > moving the mouse is never supposed to change the selected window away > from the minibuffer. Many platforms explicitly check if the selected > window is the minibuffer before emitting the event, but > not all platforms do (see list above). > > And on all platforms, including ones without the explicit check we get > the intended behavior from our testing. > > So my question is should we copy the explicit check to prevent > events from being emitted to xt-mouse.el as well, even > though it does not appear to be necessary from our testing? The mini-window test was added by Martin, AFAICT, as part of rewriting the mouse-autoselect-window support. Martin, do you remember why you added the MINI_WINDOW_P test in xterm.c, but not, for example, in w32term.c? In any case, I couldn't find any problems with the current behavior on MS-Windows when mouse-autoselect-window is non-nil.