From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Po Lu via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#61241: 29.0.60; Incoherent last_mouse_window (xterm.c) between XInput and XInput 2 Date: Tue, 22 Aug 2023 14:59:00 +0800 Message-ID: <87msyj8swb.fsf@yahoo.com> References: <87cz6n8tb1.fsf@yahoo.com> Reply-To: Po Lu Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="10561"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: 61241@debbugs.gnu.org, Eli Zaretskii To: =?UTF-8?Q?Adri=C3=A1n_?= =?UTF-8?Q?Medra=C3=B1o?= Calvo Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue Aug 22 09:00:18 2023 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 1qYLNB-0002X3-UO for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 22 Aug 2023 09:00:18 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1qYLMv-0007k6-Ri; Tue, 22 Aug 2023 03:00:01 -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 1qYLMt-0007j3-QT for bug-gnu-emacs@gnu.org; Tue, 22 Aug 2023 02:59:59 -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 1qYLMt-0007eX-H7 for bug-gnu-emacs@gnu.org; Tue, 22 Aug 2023 02:59:59 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1qYLMv-0005cu-QP for bug-gnu-emacs@gnu.org; Tue, 22 Aug 2023 03:00:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Po Lu Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 22 Aug 2023 07:00:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 61241 X-GNU-PR-Package: emacs Original-Received: via spool by 61241-submit@debbugs.gnu.org id=B61241.169268756421549 (code B ref 61241); Tue, 22 Aug 2023 07:00:01 +0000 Original-Received: (at 61241) by debbugs.gnu.org; 22 Aug 2023 06:59:24 +0000 Original-Received: from localhost ([127.0.0.1]:58436 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYLMJ-0005bU-MH for submit@debbugs.gnu.org; Tue, 22 Aug 2023 02:59:23 -0400 Original-Received: from sonic313-10.consmr.mail.ne1.yahoo.com ([66.163.185.33]:35202) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1qYLMH-0005bD-56 for 61241@debbugs.gnu.org; Tue, 22 Aug 2023 02:59:21 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=yahoo.com; s=s2048; t=1692687552; bh=Cp++GIWQ9YayqjTSeaT0fcrOVLhGDUDGAT8D1v2mNqU=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From:Subject:Reply-To; b=HFSPVfWd8UWF/QM2zQwMVsEV9vqVc9bnCEeRrbZCuLn+/U8PHDxuDd6L/vcDEwRU7cCzmdsZo0/8VerZG3rXAZMaukkMUFTr5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sBovz4vFaG5QBcDz0OaRDSPOy4.e8yjD8yTczkdIDw89ekhGYU jYryJ9Kp9n708kMPmVwj_2kZFsZAVx.BHdKywiiMa.m8ftyyrNF.5MaR6t7QgH2ghlKsDCoWNubv 71nkU_7uaW3refuYkblST.zhsRPGneTUzdM30NMasuep7wafRzfPMvj8bhulfsOpTrSgeYwsF_CN fOhazDa7id9wmL0942r97vzl7MHGOjeE_GYzxkT6GEA.Itg5pYcB9TC2kkcoHAUoIXp3kdLpF6Xf VPD5l4ja2K3BfcdtRBjZBkBPsUkdR80V4Tg32oX65Msd467IrG1J1xR11cKI8ceDTBsFbVWmiERh XJZC2y5iTv9eRqWdhGSE9jYr1OdkiC5mOJCkHbWzu9TwdIJoggAu4sqSVfoxaa0hgMqtIgTVTxan RG6SIwxKLFZxkRJu7YcD3FnjCGinycAsoRSLO3V7sGCq.IohdZOPQtLbUlFBZb1osz_IL3XVkgwy q.VLNPhYfhuQTK5zs20xoFDIpf8iIXqZKkiXynOczA X-Sonic-MF: X-Sonic-ID: 26765c9f-83a9-45ca-aebe-545b64a604b1 Original-Received: from sonic.gate.mail.ne1.yahoo.com by sonic313.consmr.mail.ne1.yahoo.com with HTTP; Tue, 22 Aug 2023 06:59:12 +0000 Original-Received: by hermes--production-sg3-69654d8bd-gltbk (Yahoo Inc. Hermes SMTP Server) with ESMTPA ID 890266537ffbdcdf1f91171a06dbb85a; Tue, 22 Aug 2023 06:59:05 +0000 (UTC) In-Reply-To: ("=?UTF-8?Q?Adri=C3=A1n_?= =?UTF-8?Q?Medra=C3=B1o?= Calvo"'s message of "Tue, 22 Aug 2023 07:45:53 +0200") X-Mailer: WebService/1.1.21732 mail.backend.jedi.jws.acl:role.jedi.acl.token.atz.jws.hermes.yahoo 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:268146 Archived-At: Adri=C3=A1n Medra=C3=B1o Calvo writes: > I prepared a patch (attached below) introducing a new lisp variable > holding the last "mouse-autoselected=E2=80=9D window. With this patch EX= WM > can simply select the Emacs window corresponding to the managed X > window and set it as last =E2=80=9Cmouse-autoselected=E2=80=9D window; > mouse-autoselect works normally after that. No more sending Motion > events. > > Using a single variable introduces a significant change, though: when > `mouse-autoselect-window=E2=80=99 is enabled and emacs runs in different > terminals, =E2=80=9Cmouse-autoselecting=E2=80=9D a window on a terminal c= hanges the > last =E2=80=9Cmouse-autoselected=E2=80=9D window for all other terminals.= Slightly > moving the mouse in a different terminal (within a single Emacs > window) will =E2=80=9Cmouse-autoselect=E2=80=9D that window, whereas that= would not > have been the case before this patch, as the last =E2=80=9Cmouse-autosele= cted=E2=80=9D > window was terminal-specific. It=E2=80=99s not clear to me whether this > behaviour will be beneficial, neutral or unacceptable. Moreover, this > behaviour is consistent with the behaviour introduced in the first > patch I sent, where I proposed to merge the last =E2=80=9Cmouse-autoselec= ted=E2=80=9D > window for Motion and XI_Motion events (other terminals were not > affected). Thanks. Taking into account your experiences with the TEST extension, I'm inclined towards believing that such a change is TRT, but the variable should be made terminal-local instead. (Emacs Lisp does provide such a facility.) Also, there are a few difficulties with the patch you attached. First of all, it obsoletes an existing variable without due reason, and that should be avoided. Secondly, :version specifiers within the patch should be revised to mention Emacs 30, since such a large change is not apposite for the release branch. Finally, you missed the new terminal backend introduced in Emacs 30, src/androidterm.c.