Subject: bug#66655: 29.1; Clicking buttons sometimes doesn't work

From: Eli Zaretskii <[email-masked]>
Date: Wed, 25 Oct 2023 19:45:59 +0300

> From: Stefan Monnier <[email-masked]>
> Cc: [email-masked],  [email-masked]
> Date: Wed, 25 Oct 2023 12:36:00 -0400
> 
> 		if (mouse_has_moved
> 		    && (!EQ (Fcar (Fcdr (start_pos)),
> 			     Fcar (Fcdr (position))))
> 		    && EQ (Fcar (start_pos), Fcar (position)))
> 
> The main purpose of the change is to address the "FIXME" in the comment:
> if the mouse hasn't moved, I don't think we should generate a `drag`
> even if the buffer content under the mouse has changed.

But then we are back at the problem which the buffer-position check
tries to address:

                       /* 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.  */

IOW, just testing the screen coordinates is not enough.

> So, IIUC, what you were saying is that with the new code, a small
> movement that goes from one buffer position to another both of which are
> within the fuzz will be considered as a click whereas with the current
> code it will be a `drag`.  Maybe that's worse than the "FIXME" issue it
> tries to address?
> 
> The other part of the change is the handling of `EQ (Fcar (start_pos),
> Fcar (position))` and I must admit I don't know what to do with it, so
> this part of the change is largely arbitrary: I don't know why we
> currently check this condition nor why we only check it when mouse has
> not moved.

I think the comment above explains that, or at least tries to.