From mboxrd@z Thu Jan 1 00:00:00 1970 Path: news.gmane.io!.POSTED.blaine.gmane.org!not-for-mail From: Stefan Monnier via "Bug reports for GNU Emacs, the Swiss army knife of text editors" Newsgroups: gmane.emacs.bugs Subject: bug#66655: 29.1; Clicking buttons sometimes doesn't work Date: Mon, 23 Oct 2023 12:38:35 -0400 Message-ID: References: <1d9187b71e7288eaf08ac9a2f0559bdf@gmail.com> <8334y4s0oe.fsf@gnu.org> Reply-To: Stefan Monnier Mime-Version: 1.0 Content-Type: text/plain Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="5511"; mail-complaints-to="usenet@ciao.gmane.io" User-Agent: Gnus/5.13 (Gnus v5.13) Cc: tomasralph2000@gmail.com, 66655@debbugs.gnu.org To: Eli Zaretskii Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 23 18:42:23 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 1quy0V-0001CH-60 for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 23 Oct 2023 18:42:23 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quxzo-0006NN-SB; Mon, 23 Oct 2023 12:41:40 -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 1quxzh-0006Mm-8X for bug-gnu-emacs@gnu.org; Mon, 23 Oct 2023 12:41:34 -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 1quxzh-0007Qx-0R for bug-gnu-emacs@gnu.org; Mon, 23 Oct 2023 12:41:33 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1quy0A-0003Iv-0k for bug-gnu-emacs@gnu.org; Mon, 23 Oct 2023 12:42:02 -0400 X-Loop: help-debbugs@gnu.org Resent-From: Stefan Monnier Original-Sender: "Debbugs-submit" Resent-CC: bug-gnu-emacs@gnu.org Resent-Date: Mon, 23 Oct 2023 16:42:01 +0000 Resent-Message-ID: Resent-Sender: help-debbugs@gnu.org X-GNU-PR-Message: followup 66655 X-GNU-PR-Package: emacs X-GNU-PR-Keywords: fixed Original-Received: via spool by 66655-submit@debbugs.gnu.org id=B66655.169807928412657 (code B ref 66655); Mon, 23 Oct 2023 16:42:01 +0000 Original-Received: (at 66655) by debbugs.gnu.org; 23 Oct 2023 16:41:24 +0000 Original-Received: from localhost ([127.0.0.1]:51452 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quxzX-0003I4-Je for submit@debbugs.gnu.org; Mon, 23 Oct 2023 12:41:23 -0400 Original-Received: from mailscanner.iro.umontreal.ca ([132.204.25.50]:52680) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quxzV-0003Hp-Av for 66655@debbugs.gnu.org; Mon, 23 Oct 2023 12:41:22 -0400 Original-Received: from pmg3.iro.umontreal.ca (localhost [127.0.0.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id B134C442AF6; Mon, 23 Oct 2023 12:40:46 -0400 (EDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=iro.umontreal.ca; s=mail; t=1698079245; bh=uNFr8zL9rLj9bbbjVOh7RZaRZGU7oHnq1obp/8d6XCQ=; h=From:To:Cc:Subject:In-Reply-To:References:Date:From; b=B2ZG08pQDXKrxXnkRCIf1avdf/vGbbHVtoaff5rtGQPvyGxVbuY7L1vRECJG5ZbEQ GMYQYVsg22DauzA+UKwuqKb2/GHduwptlIz7Ydxi2Qr/1TRVsaiUw4DiTCIVSH4GU9 UsFQ02SY95qW651NR0hsmY1XsN2tCnos17PujgBZUgRdFDi644C5Mhwq3Ypr0craDu zkv7s75I+jXzx6rPipSHPChC5rOlpSwPKq9Au7Thc3+ixaG9oFvaVkIWTVH+gQ8m3R R1f14Qjx4w9PM5fmU9kWLDbHxgoUfLbPiuU7jvTLpBgpGenbYXk3yoOEK9Fu6P6VUy MGptHkwKlVx0A== Original-Received: from mail01.iro.umontreal.ca (unknown [172.31.2.1]) by pmg3.iro.umontreal.ca (Proxmox) with ESMTP id 2CD3A442AEC; Mon, 23 Oct 2023 12:40:45 -0400 (EDT) Original-Received: from lechazo (lechon.iro.umontreal.ca [132.204.27.242]) by mail01.iro.umontreal.ca (Postfix) with ESMTPSA id 1D305120376; Mon, 23 Oct 2023 12:40:45 -0400 (EDT) In-Reply-To: <8334y4s0oe.fsf@gnu.org> (Eli Zaretskii's message of "Sat, 21 Oct 2023 13:57:21 +0300") 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:273030 Archived-At: > Stefan, I'd appreciate your review of the change, as this is a tricky > code, where we already had quite a few changes to avoid interpreting > an up-event as a drag event. The change looks OK. But yeah, it does feel like adding yet an other hack. The whole: /* Maybe the mouse has moved a lot, caused scrolling, and eventually ended up at the same screen position (but not buffer position) in which case it is a drag, not a click. */ /* FIXME: OTOH if the buffer position has changed because of a timer or process filter rather than because of mouse movement, it should be considered as a click. But mouse-drag-region completely ignores this case and it hasn't caused any real problem, so it's probably OK to ignore it as well. */ && (EQ (Fcar (Fcdr (start_pos)), Fcar (Fcdr (position))) /* Same buffer pos */ /* Redisplay hscrolled text between down- and up-events due to display-line-numbers-mode. */ || line_number_mode_hscroll (start_pos, position) || !EQ (Fcar (start_pos), Fcar (position))))) /* Different window */ is unsatisfactory. But it's not clear what is the right way to look at the problem. As the comment says, we generally want "down+scroll+up" to be treated as a drag, but not in the current case. I think the difference relies on what caused the scroll: if the scroll was the result of a deliberate act by the user (they moved the mouse after `down` to cause a scroll), then it's a drag and else it's not? Stefan