From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Alan Mackenzie Newsgroups: gmane.emacs.bugs Subject: bug#48409: Text runs away before user can copy it Date: Tue, 18 May 2021 20:23:55 +0000 Message-ID: References: <87cztt4yg9.5.fsf@jidanni.org> <83fsypztd4.fsf@gnu.org> <87cztt9qdj.fsf@mail.linkov.net> <83mtsxxfo8.fsf@gnu.org> <87h7j12j93.fsf@mail.linkov.net> <83bl98rxqo.fsf@gnu.org> <83k0nvrhgg.fsf@gnu.org> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="25075"; mail-complaints-to="usenet@ciao.gmane.io" Cc: acm@muc.de, 48409@debbugs.gnu.org, juri@linkov.net To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Tue May 18 22:35:12 2021 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 1lj6Qq-0006If-1g for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 May 2021 22:35:12 +0200 Original-Received: from localhost ([::1]:37772 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1lj6Qp-0005IS-1C for geb-bug-gnu-emacs@m.gmane-mx.org; Tue, 18 May 2021 16:35:11 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:46030) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1lj6H0-0003sK-Hf for bug-gnu-emacs@gnu.org; Tue, 18 May 2021 16:25:04 -0400 Original-Received: from debbugs.gnu.org ([209.51.188.43]:45844) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.90_1) (envelope-from ) id 1lj6Gz-0005lG-OC for bug-gnu-emacs@gnu.org; Tue, 18 May 2021 16:25:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1lj6Gz-0000Hl-JG for bug-gnu-emacs@gnu.org; Tue, 18 May 2021 16:25:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Alan Mackenzie Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Tue, 18 May 2021 20:25:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 48409 X-GNU-PR-Package: emacs Original-Received: via spool by 48409-submit@debbugs.gnu.org id=B48409.16213694451033 (code B ref 48409); Tue, 18 May 2021 20:25:01 +0000 Original-Received: (at 48409) by debbugs.gnu.org; 18 May 2021 20:24:05 +0000 Original-Received: from localhost ([127.0.0.1]:57390 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1lj6G5-0000Ga-El for submit@debbugs.gnu.org; Tue, 18 May 2021 16:24:05 -0400 Original-Received: from colin.muc.de ([193.149.48.1]:54163 helo=mail.muc.de) by debbugs.gnu.org with smtp (Exim 4.84_2) (envelope-from ) id 1lj6G2-0000G4-EQ for 48409@debbugs.gnu.org; Tue, 18 May 2021 16:24:03 -0400 Original-Received: (qmail 89872 invoked by uid 3782); 18 May 2021 20:23:56 -0000 Original-Received: from acm.muc.de (p4fe1589d.dip0.t-ipconnect.de [79.225.88.157]) (using STARTTLS) by colin.muc.de (tmda-ofmipd) with ESMTP; Tue, 18 May 2021 22:23:55 +0200 Original-Received: (qmail 17279 invoked by uid 1000); 18 May 2021 20:23:55 -0000 Content-Disposition: inline In-Reply-To: <83k0nvrhgg.fsf@gnu.org> X-Submission-Agent: TMDA/1.3.x (Ph3nix) X-Primary-Address: acm@muc.de 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" Xref: news.gmane.io gmane.emacs.bugs:206836 Archived-At: Hello, Eli. On Tue, May 18, 2021 at 22:05:03 +0300, Eli Zaretskii wrote: > > Date: Tue, 18 May 2021 18:42:16 +0000 > > Cc: Juri Linkov , 48409@debbugs.gnu.org > > From: Alan Mackenzie > > How can a simple stationary click in the echo area become a drag event? > > I'm guessing there's some subtle bug in some function such as > > make_lispy_event in keyboard.c. Any mouse experts who have suggestions, > > please chime in, here! > I think this is explained at the end of the node "Drag Events" in the > ELisp manual. Erm, not really. That bit explains how a drag event can become a click event, not the other way around. Thanks anyhow. I think I know why the problem is happening. When there are two lines of text in the miniwindow: (i) A down-mouse event occurs in the miniwindow: o - the mouse position relative to the top of the two-line miniwindow is stored somewhere. o - redisplay (or something) changes the two-line miniwindow into a one-line miniwindow. (ii) The up-mouse event occurs in the same place: o - the mouse position is determined RELATIVE TO THE NEWLY SIZED MINIWINDOW. o - The y coordinate is significantly different from that of the stored mouse position. o - Due to this difference, make_lispy_event thinks the mouse has moved, so returns a drag event. The above is the basic scenario. If the mouse is on the top line of the miniwindow when the mouse is clicked, the returned y coordinate at (ii) is in the mode line of the window above, and is determined relative to that window. I don't have any workable ideas on how to fix this bug. The only idea which springs to mind is to move from expressing mouse positions relative to a window to expressing it relative to a frame. Or, maybe the resizing of the miniwindow could be postponed till after the up-mouse event. Who is the mouse expert in Emacs? What does he say? -- Alan Mackenzie (Nuremberg, Germany).