[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [PATCH v3 1/3] Improve interaction between mouse-drag-region and scr
From: |
Yuri D'Elia |
Subject: |
Re: [PATCH v3 1/3] Improve interaction between mouse-drag-region and scroll-margin |
Date: |
Sun, 26 Sep 2021 14:33:02 +0200 |
User-agent: |
Gnus/5.13 (Gnus v5.13) Emacs/28.0.50 (gnu/linux) |
On Sat, Sep 25 2021, Yuri D'Elia wrote:
> Clicking inside the scroll-margin region still occasionally causes some
> regions to be selected, ....
I spent some extra time digging into this specific edge case that was
remaining, as I still consider it buggy.
To sum up: now the click and drag behave as expected within the
scroll-margin region, but I *still* noticed sometimes a word or a line
would unexpectedly be selected.
Turns out the code is correct. It's a much dumber problem:
When clicking inside the scroll-margin region, the point is moved and
the buffer is scrolled. So far so good.
So I would just click again on the same spot for testing. This would
scroll more. But it the mouse hasn't moved, so this event would *also*
count as a double-click (and triple, if done in succession) if done fast
enough.
It's technically correct, since you *might* be trying to do a legitimate
double-click. However, if you click within any autoscroll region, the
buffer is scrolled after releasing the button. Such attempt results in
two scrolls, or more. Having this select /anything/ and at the same time
move it away from view is broken IMHO.
My thinking would be that if scrolling happens between the down-mouse
and up-mouse event, we shouldn't count subsequent clicks as repeated.
However the repeat count seems to come from a higher level which I'm not
familiar with. I'm not sure how would I approach such a fix.
Ideas?