GNU bug report logs - #42150
28.0.50; Bad mouse interaction in the scroll-margin region

Previous Next

Package: emacs;

Reported by: Yuri D'Elia <wavexx <at> thregr.org>

Date: Wed, 1 Jul 2020 12:31:01 UTC

Severity: normal

Found in version 28.0.50

To reply to this bug, email your comments to 42150 AT debbugs.gnu.org.

Toggle the display of automated, internal messages from the tracker.

View this report as an mbox folder, status mbox, maintainer mbox


Report forwarded to bug-gnu-emacs <at> gnu.org:
bug#42150; Package emacs. (Wed, 01 Jul 2020 12:31:01 GMT) Full text and rfc822 format available.

Acknowledgement sent to Yuri D'Elia <wavexx <at> thregr.org>:
New bug report received and forwarded. Copy sent to bug-gnu-emacs <at> gnu.org. (Wed, 01 Jul 2020 12:31:01 GMT) Full text and rfc822 format available.

Message #5 received at submit <at> debbugs.gnu.org (full text, mbox):

From: Yuri D'Elia <wavexx <at> thregr.org>
To: bug-gnu-emacs <at> gnu.org
Subject: 28.0.50; Bad mouse interaction in the scroll-margin region
Date: Wed, 01 Jul 2020 14:30:14 +0200
The combined behavior of the mouse and "scroll-margin" is a bit odd
currently.

If you have a buffer which has "scroll-margin" enabled, and you click
anywhere in the scroll-margin region, the point is moved and the buffer
is immediately scrolled.

This in turn often results in the click becoming a "drag" instead,
selecting parts of the buffer.

I rarely use the mouse, but when I do (usually in customize groups, or
when using eww), it trips me all the time since I use a rather large
scroll-margin.

If feels like that moving the point when using the mouse shouldn't
trigger scroll-margin ever, since any action that causes a scroll would
immediately move the current target away and result in unintended
behavior. I can see the same effect when performing a selection by
dragging: once you reach the scroll-margin area every single motion
events selects half the visible buffer, which is also broken.

In GNU Emacs 28.0.50 (build 36, x86_64-pc-linux-gnu, X toolkit, cairo version 1.16.0, Xaw scroll bars)
 of 2020-06-30 built on eab18045nb
Repository revision: bc8089a3fa11161428c51439fd3b26fd6583345d
Repository branch: master
Windowing system distributor 'The X.Org Foundation', version 11.0.12008000
System Description: Debian GNU/Linux bullseye/sid

Configured using:
 'configure --with-x-toolkit=lucid --with-modules --without-gsettings
 --with-cairo CC=gcc 'CFLAGS=-O3 -march=native -pipe '
 LDFLAGS=-fwhole-program'

Configured features:
XPM JPEG TIFF GIF PNG RSVG CAIRO SOUND DBUS GLIB NOTIFY INOTIFY ACL
LIBSELINUX GNUTLS LIBXML2 FREETYPE HARFBUZZ LIBOTF ZLIB
TOOLKIT_SCROLL_BARS LUCID X11 XDBE XIM MODULES THREADS LIBSYSTEMD JSON
PDUMPER LCMS2 GMP





Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42150; Package emacs. (Wed, 01 Jul 2020 14:14:02 GMT) Full text and rfc822 format available.

Message #8 received at 42150 <at> debbugs.gnu.org (full text, mbox):

From: Eli Zaretskii <eliz <at> gnu.org>
To: Yuri D'Elia <wavexx <at> thregr.org>
Cc: 42150 <at> debbugs.gnu.org
Subject: Re: bug#42150: 28.0.50;
 Bad mouse interaction in the scroll-margin region
Date: Wed, 01 Jul 2020 17:13:23 +0300
> From: Yuri D'Elia <wavexx <at> thregr.org>
> Date: Wed, 01 Jul 2020 14:30:14 +0200
> 
> The combined behavior of the mouse and "scroll-margin" is a bit odd
> currently.

As discussed elsewhere, the problem here is to define alternative
behavior that could make sense while preventing the downsides.

> If you have a buffer which has "scroll-margin" enabled, and you click
> anywhere in the scroll-margin region, the point is moved and the buffer
> is immediately scrolled.

That is true, but it's the intended behavior: a mouse clock sets
point, and the scroll-margin says scroll the window when point enters
the margin for any reason.  So this does what it should do.

> This in turn often results in the click becoming a "drag" instead,
> selecting parts of the buffer.

This part I couldn't reproduce.  Maybe it's specific to the
window-system you are using or to something else that isn't Emacs per
se.

> If feels like that moving the point when using the mouse shouldn't
> trigger scroll-margin ever, since any action that causes a scroll would
> immediately move the current target away and result in unintended
> behavior.

I don't think I understand what you mean by "move the current target
away".  Text scrolls, but it doesn't scroll out of the window, at
least not in my testing.

> I can see the same effect when performing a selection by
> dragging: once you reach the scroll-margin area every single motion
> events selects half the visible buffer, which is also broken.

You need to select "carefully", and then it doesn't select half of the
window, but only what you dragged across.  But yes, this is a bit
tricky.

Once again, the problem is to decide what to do instead.

Thanks.




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42150; Package emacs. (Wed, 02 Sep 2020 22:04:02 GMT) Full text and rfc822 format available.

Message #11 received at 42150 <at> debbugs.gnu.org (full text, mbox):

From: Stefan Kangas <stefan <at> marxist.se>
To: Eli Zaretskii <eliz <at> gnu.org>
Cc: Yuri D'Elia <wavexx <at> thregr.org>, 42150 <at> debbugs.gnu.org
Subject: Re: bug#42150: 28.0.50;
 Bad mouse interaction in the scroll-margin region
Date: Wed, 2 Sep 2020 18:03:15 -0400
Eli Zaretskii <eliz <at> gnu.org> writes:

>> This in turn often results in the click becoming a "drag" instead,
>> selecting parts of the buffer.
>
> This part I couldn't reproduce.  Maybe it's specific to the
> window-system you are using or to something else that isn't Emacs per
> se.

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




Information forwarded to bug-gnu-emacs <at> gnu.org:
bug#42150; Package emacs. (Sun, 31 Oct 2021 13:55:02 GMT) Full text and rfc822 format available.

Message #14 received at 42150 <at> debbugs.gnu.org (full text, mbox):

From: Yuri D'Elia <wavexx <at> thregr.org>
To: Stefan Kangas <stefan <at> marxist.se>
Cc: Eli Zaretskii <eliz <at> gnu.org>, 42150 <at> debbugs.gnu.org
Subject: Re: bug#42150: 28.0.50; Bad mouse interaction in the scroll-margin
 region
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.




This bug report was last modified 2 years and 178 days ago.

Previous Next


GNU bug tracking system
Copyright (C) 1999 Darren O. Benham, 1997,2003 nCipher Corporation Ltd, 1994-97 Ian Jackson.