unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
From: Eli Zaretskii <eliz@gnu.org>
To: Stefan Monnier <monnier@iro.umontreal.ca>
Cc: tomasralph2000@gmail.com, 66655@debbugs.gnu.org
Subject: bug#66655: 29.1; Clicking buttons sometimes doesn't work
Date: Thu, 26 Oct 2023 08:07:52 +0300	[thread overview]
Message-ID: <837cnahsyf.fsf@gnu.org> (raw)
In-Reply-To: <jwvv8auifsz.fsf-monnier+emacs@gnu.org> (message from Stefan Monnier on Wed, 25 Oct 2023 17:22:41 -0400)

> From: Stefan Monnier <monnier@iro.umontreal.ca>
> Cc: tomasralph2000@gmail.com,  66655@debbugs.gnu.org
> Date: Wed, 25 Oct 2023 17:22:41 -0400
> 
> >> In my "in short is approximately" I used `mouse_has_moved` but that
> >> was an oversimplification: in the new code `mouse_has_moved` doesn't
> >> revert to "false" when the mouse returns to the original position,
> >> contrary to what happen in the current code.
> >
> > How exactly does that happen?
> 
> Because as soon as `note_mouse_highlight` receives information that the
> mouse is outside of the fuzz, the var is set to `false` [ And it's only
> set to true when we get the mouse-down event ].

I don't think I understand this explanation.  (Did you mean "true"
instead of "false"?)

You started by saying that your code detects mouse movement, and I
asked how does it detect it.  AFAIR, Emacs doesn't receive
mouse-motion events unless we turn on track-mouse, which we usually
avoid doing.  So this code was originally detecting mouse movement by
comparing the screen coordinates of the down- and up-events.  I'm
asking how is your code different?

> >> The comment above talks about buffer positions (i.e. the Fcar+Fcdr
> >> part of the positions), whereas this `EQ` tests the windows, and the
> >> only relevant comment I see is
> >> 
> >>     /* Different window */
> >> 
> >> which reminds the reader that it's comparing windows but doesn't say why.
> >> Did I miss something?
> >
> > Yes: we can be at the same buffer position, but a different window.
> 
> Right, but what's the problem with that?

You could have redisplay change the windows under your feet, such that
the screen coordinates are the same, the buffer position is the same,
but the window is not the same.  That test wants to emit a drag event
in such a case.  That is my understanding of the test.

> I see now that this was done (in commit
> 6e2d3bce087d30a535b1f01715d7820576ffe390) to handle the case where
> a mouse click causes some window-shuffle, so the up event ends up
> pointing into another window.

Exactly.

> I think my code is immune to this problem since with it we only ever
> generate a drag event if the mouse actually moved.  Which leads to
> a further simplification of the code, see patch below.

I still don't understand the implication of the mouse_has_moved part.





  reply	other threads:[~2023-10-26  5:07 UTC|newest]

Thread overview: 31+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-10-20 20:27 bug#66655: 29.1; Clicking buttons sometimes doesn't work tomasralph2000
2023-10-20 20:38 ` Stefan Kangas
2023-10-21 10:57 ` Eli Zaretskii
2023-10-21 11:23   ` Stefan Kangas
2023-10-21 11:34     ` Eli Zaretskii
2023-10-21 12:05   ` Stefan Kangas
2023-10-23 16:38   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-23 18:30     ` Eli Zaretskii
2023-10-23 22:36       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-24 12:14         ` Eli Zaretskii
2023-10-24 13:44           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-24 13:53             ` Eli Zaretskii
2023-10-24 13:57               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-24 14:18                 ` Eli Zaretskii
2023-10-24 14:29                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-24 14:36                     ` Eli Zaretskii
2023-10-24 14:50                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-24 15:41                         ` Eli Zaretskii
2023-10-24 22:00                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-25 11:59                             ` Eli Zaretskii
2023-10-25 15:13                               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-25 16:08                                 ` Eli Zaretskii
2023-10-25 16:36                                   ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-25 16:45                                     ` Eli Zaretskii
2023-10-25 17:27                                       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-25 18:29                                         ` Eli Zaretskii
2023-10-25 21:22                                           ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-26  5:07                                             ` Eli Zaretskii [this message]
2023-10-26 14:05                                               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-24 13:59               ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors
2023-10-23 23:00       ` Stefan Monnier via Bug reports for GNU Emacs, the Swiss army knife of text editors

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

  List information: https://www.gnu.org/software/emacs/

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=837cnahsyf.fsf@gnu.org \
    --to=eliz@gnu.org \
    --cc=66655@debbugs.gnu.org \
    --cc=monnier@iro.umontreal.ca \
    --cc=tomasralph2000@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).