From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.org!.POSTED!not-for-mail From: Eli Zaretskii Newsgroups: gmane.emacs.bugs Subject: bug#28658: 27.0.50; [PATCH] double/triple clicking in xterm-mouse-mode doesn't respect mouse position Date: Thu, 05 Oct 2017 13:36:00 +0300 Message-ID: <83zi95x4of.fsf@gnu.org> References: <87r2unyh79.fsf@gmail.com> Reply-To: Eli Zaretskii NNTP-Posting-Host: blaine.gmane.org X-Trace: blaine.gmane.org 1507199895 19021 195.159.176.226 (5 Oct 2017 10:38:15 GMT) X-Complaints-To: usenet@blaine.gmane.org NNTP-Posting-Date: Thu, 5 Oct 2017 10:38:15 +0000 (UTC) Cc: 28658@debbugs.gnu.org To: Alex Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane.org@gnu.org Thu Oct 05 12:38:11 2017 Return-path: Envelope-to: geb-bug-gnu-emacs@m.gmane.org Original-Received: from lists.gnu.org ([208.118.235.17]) by blaine.gmane.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e03Xe-0004Lu-Mh for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Oct 2017 12:38:10 +0200 Original-Received: from localhost ([::1]:38985 helo=lists.gnu.org) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e03Xm-0000OT-3d for geb-bug-gnu-emacs@m.gmane.org; Thu, 05 Oct 2017 06:38:18 -0400 Original-Received: from eggs.gnu.org ([2001:4830:134:3::10]:50524) by lists.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e03Wd-0008Ib-94 for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2017 06:37:08 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e03WY-0006sC-91 for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2017 06:37:07 -0400 Original-Received: from debbugs.gnu.org ([208.118.235.43]:41108) by eggs.gnu.org with esmtps (TLS1.0:RSA_AES_128_CBC_SHA1:16) (Exim 4.71) (envelope-from ) id 1e03WY-0006s2-5l for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2017 06:37:02 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1e03WX-0001du-TK for bug-gnu-emacs@gnu.org; Thu, 05 Oct 2017 06:37:01 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Eli Zaretskii Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Thu, 05 Oct 2017 10:37:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 28658 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: patch Original-Received: via spool by 28658-submit@debbugs.gnu.org id=B28658.15071997846264 (code B ref 28658); Thu, 05 Oct 2017 10:37:01 +0000 Original-Received: (at 28658) by debbugs.gnu.org; 5 Oct 2017 10:36:24 +0000 Original-Received: from localhost ([127.0.0.1]:49788 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e03Vw-0001cy-I7 for submit@debbugs.gnu.org; Thu, 05 Oct 2017 06:36:24 -0400 Original-Received: from eggs.gnu.org ([208.118.235.92]:59336) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1e03Vu-0001cl-FI for 28658@debbugs.gnu.org; Thu, 05 Oct 2017 06:36:22 -0400 Original-Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1e03Vk-0005zt-76 for 28658@debbugs.gnu.org; Thu, 05 Oct 2017 06:36:17 -0400 Original-Received: from fencepost.gnu.org ([2001:4830:134:3::e]:46622) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1e03Vk-0005zS-3t; Thu, 05 Oct 2017 06:36:12 -0400 Original-Received: from 84.94.185.246.cable.012.net.il ([84.94.185.246]:2871 helo=home-c4e4a596f7) by fencepost.gnu.org with esmtpsa (TLS1.2:RSA_AES_256_CBC_SHA1:256) (Exim 4.82) (envelope-from ) id 1e03Vj-00078W-GM; Thu, 05 Oct 2017 06:36:11 -0400 In-reply-to: <87r2unyh79.fsf@gmail.com> (message from Alex on Sat, 30 Sep 2017 16:06:34 -0600) X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-BeenThere: debbugs-submit@debbugs.gnu.org X-Mailman-Version: 2.1.18 Precedence: list X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] X-Received-From: 208.118.235.43 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.org@gnu.org Original-Sender: "bug-gnu-emacs" Xref: news.gmane.org gmane.emacs.bugs:137955 Archived-At: > From: Alex > Date: Sat, 30 Sep 2017 16:06:34 -0600 > > 1. emacs -Q -nw > 2. M-x xterm-mouse-mode RET > 3. Click once, then quickly move the cursor to a different word and click again. > 4. Notice that the 2nd click was registered as a double click even > though the cursor moved. > 5. Click once, and quickly perform step 3 again. Notice that the 3rd > click was registered as a triple click even though the cursor moved. > > I've attached a patch that fixes this behaviour. Thanks, I have a comment to this, but in general this is the right fix, IMO. > It would be nice if it worked with pixel positions rather than > character positions, but I'm not sure how to do that in a terminal > Emacs. You can't: TTY frames cannot discern screen positions with resolution of more than 1 character. > @@ -290,12 +292,14 @@ xterm-mouse-event > (xterm-mouse--set-click-count event click-count))) > ((not last-time) nil) > ((and (> double-click-time (* 1000 (- this-time last-time))) > + (eq x last-x) > + (eq y last-y) IMO, 'eq' is not right here: this test should obey the value of double-click-fuzz, whose units on TTY frames are 1/8 of a character.