Subject: Re: bug#42150: 28.0.50; Bad mouse interaction in the scroll-margin region

From: Yuri D'Elia <[email-masked]>
Date: Sun, 31 Oct 2021 14:47:40 +0100

On Wed, Sep 02 2020, Stefan Kangas wrote:
> I can reproduce this if I click mouse-1, hold the mouse button down and
> then move the mouse cursor.  Tried on:
>
> In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, X toolkit, cairo
> version 1.16.0, Xaw3d scroll bars)
>  of 2020-08-17 built on joffe
>
> In GNU Emacs 28.0.50 (build 1, x86_64-pc-linux-gnu, GTK+ Version
> 3.24.22, cairo version 1.16.0)
>  of 2020-09-02 built on joffe

For posterity, a partial fix for this behavior has been merged through
my commit patch in e62d1fa9831cc4f046b330f438f8bd49a27a2458.

There is still one scenario which IMHO deserves to be fixed before we
can close this: double-clicking inside the scroll-margin area turns the
double-click into a double-click+scroll (or triple+scroll).

This happens because the click-count is handled at the term level, and
doesn't see that the "logical" click coordinate has been shifted as a
result of the scroll.

The scrolling in this case should also reset the current click count.