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#66655: 29.1; Clicking buttons sometimes doesn't work Date: Mon, 23 Oct 2023 21:30:38 +0300 Message-ID: <83v8axmbsh.fsf@gnu.org> References: <1d9187b71e7288eaf08ac9a2f0559bdf@gmail.com> <8334y4s0oe.fsf@gnu.org> Injection-Info: ciao.gmane.io; posting-host="blaine.gmane.org:116.202.254.214"; logging-data="32352"; mail-complaints-to="usenet@ciao.gmane.io" Cc: tomasralph2000@gmail.com, 66655@debbugs.gnu.org To: Stefan Monnier Original-X-From: bug-gnu-emacs-bounces+geb-bug-gnu-emacs=m.gmane-mx.org@gnu.org Mon Oct 23 20:32:07 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 1quzig-000860-JG for geb-bug-gnu-emacs@m.gmane-mx.org; Mon, 23 Oct 2023 20:32:06 +0200 Original-Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1quziO-0008Ar-VR; Mon, 23 Oct 2023 14:31:49 -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 1quzi9-00082h-8Z for bug-gnu-emacs@gnu.org; Mon, 23 Oct 2023 14:31:38 -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 1quzi9-0003Fg-0F for bug-gnu-emacs@gnu.org; Mon, 23 Oct 2023 14:31:33 -0400 Original-Received: from Debian-debbugs by debbugs.gnu.org with local (Exim 4.84_2) (envelope-from ) id 1quzib-0006Ic-Po for bug-gnu-emacs@gnu.org; Mon, 23 Oct 2023 14:32: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: Mon, 23 Oct 2023 18:32: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.169808587924164 (code B ref 66655); Mon, 23 Oct 2023 18:32:01 +0000 Original-Received: (at 66655) by debbugs.gnu.org; 23 Oct 2023 18:31:19 +0000 Original-Received: from localhost ([127.0.0.1]:51656 helo=debbugs.gnu.org) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quzhv-0006Hg-7H for submit@debbugs.gnu.org; Mon, 23 Oct 2023 14:31:19 -0400 Original-Received: from eggs.gnu.org ([2001:470:142:3::10]:36368) by debbugs.gnu.org with esmtp (Exim 4.84_2) (envelope-from ) id 1quzhq-0006HQ-1T for 66655@debbugs.gnu.org; Mon, 23 Oct 2023 14:31:17 -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 1quzhG-00034I-MV; Mon, 23 Oct 2023 14:30: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=2Dq5qdsCSQTxQj3D54wweJerH/hOFFK3/o30V1USGbg=; b=Q1jYieKp5paE jVj2Y3JT/ZR1MyVWTNJszJJb7svPpPxKubFu52q+jKDn28GZ94/0z5cPxVng0yQ5RTTpH/CmUoPeu DLpMdJLwEUZJGtDGx9Mj60SSIjgUKEU4bVbySxT2m68Q8QteA117wjMk/qNx3y4SghF2RWtbAGJx+ 3gIHP4a6N9ypHLWHjDP2WCBj7K/TamKtoBE8ECwvgsIb5yCT2T7ku1qeKKFLzrm+WNYD6tfrWxse3 5WFBzuC4+95ak33i5xTLBvVv+fRsvUkIfnXDs7wgjenfqhl3oxgVGX/XYkstd9hqStOR5R1Aoz8z/ PAEcWMTQBraGm6fL6e6pWA==; In-Reply-To: (message from Stefan Monnier on Mon, 23 Oct 2023 12:38:35 -0400) 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:273042 Archived-At: > From: Stefan Monnier > Cc: tomasralph2000@gmail.com, 66655@debbugs.gnu.org > Date: Mon, 23 Oct 2023 12:38:35 -0400 > > > 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? Yes, that's the logic here. Technically, it happens because clicking the mouse emits 2 events: down-mouse-1 followed by another one caused by releasing the mouse button, and the first event could cause redisplay (as happens in this case) because it generally moves point to the location of the click.