unofficial mirror of bug-gnu-emacs@gnu.org 
 help / color / mirror / code / Atom feed
* bug#58980: 29.0.50; Mouse wheel scroll twitches up sometimes when I scroll down
@ 2022-11-02 16:20 Mickey Petersen
  2022-11-03  8:31 ` Eli Zaretskii
  0 siblings, 1 reply; 10+ messages in thread
From: Mickey Petersen @ 2022-11-02 16:20 UTC (permalink / raw)
  To: 58980


Note: I'm using the tree-sitter branch, but the issue also appears in 
the master
branch. Emacs 28.x works fine.

When I scroll down with my mouse wheel -- typically after an existing 
window has changed
buffers, such as after selecting (via keyboard or mouse) an Info manual 
node --
the scroll action sometimes (but not always) jerks upwards several
lines. I can then keep scrolling and it'll start scrolling down
again. This may sometimes happen after scrolling for a little while, and
sometimes not at all.

It's hard to reproduce; but the issue affects a baseline Emacs build (-Q or
-q) and only sometimes.

I had a look in the bug tracker for `scroll' and found nothing. I also
checked `M-x customize-changed' to look for likely culprits. I found
nothing that may cause this behaviour, beyond pixel scrolling, which 
seems like a smoking gun to me,
but it's off by default in emacs -Q.

1. Is it possible there are changes the scrolling code that is active even
when that mode is not?

2. Could there be some sort of variable that determines scroll direction 
that, somehow, gets confused?

Thanks.

Mickey.





In GNU Emacs 29.0.50 (build 2, x86_64-pc-linux-gnu, GTK+ Version
  3.24.20, cairo version 1.16.0) of 2022-10-28 built on mickey-work
Repository revision: 629f222ba2abf5a149c381e27c89e88963f7466d
Repository branch: feature/tree-sitter
Windowing system distributor 'The X.Org Foundation', version 11.0.12013000
System Description: Ubuntu 20.04.3 LTS

Configured using:
  'configure --with-mailutils --with-imagemagick --with-json
  --with-xwidgets --with-native-compilation --without-compress-install
  --with-tree-sitter'

Configured features:
ACL CAIRO DBUS FREETYPE GIF GLIB GMP GNUTLS GPM GSETTINGS HARFBUZZ
IMAGEMAGICK JPEG JSON LCMS2 LIBOTF LIBSELINUX LIBSYSTEMD LIBXML2
M17N_FLT MODULES NATIVE_COMP NOTIFY INOTIFY PDUMPER PNG RSVG SECCOMP
SOUND SQLITE3 THREADS TIFF TOOLKIT_SCROLL_BARS TREE-SITTER X11 XDBE XIM
XINPUT2 XPM XWIDGETS GTK3 ZLIB

Important settings:
   value of $LC_MONETARY: en_GB.UTF-8
   value of $LC_NUMERIC: en_GB.UTF-8
   value of $LC_TIME: en_GB.UTF-8
   value of $LANG: en_GB.UTF-8
   value of $XMODIFIERS: @im=ibus
   locale-coding-system: utf-8-unix

Major mode: Info

Minor modes in effect:
   tooltip-mode: t
   global-eldoc-mode: t
   show-paren-mode: t
   electric-indent-mode: t
   mouse-wheel-mode: t
   tool-bar-mode: t
   menu-bar-mode: t
   file-name-shadow-mode: t
   isearch-fold-quotes-mode: t
   global-font-lock-mode: t
   font-lock-mode: t
   blink-cursor-mode: t
   buffer-read-only: t
   line-number-mode: t
   indent-tabs-mode: t
   transient-mark-mode: t
   auto-composition-mode: t
   auto-encryption-mode: t
   auto-compression-mode: t

Load-path shadows:
None found.

Features:
(shadow sort mail-extr emacsbug message mailcap yank-media puny dired
dired-loaddefs rfc822 mml mml-sec password-cache epa derived epg rfc6068
epg-config gnus-util text-property-search mm-decode mm-bodies mm-encode
mail-parse rfc2231 mailabbrev gmm-utils mailheader sendmail rfc2047
rfc2045 ietf-drums mm-util mail-prsvr mail-utils mule-util info edmacro
kmacro tutorial time-date cl-loaddefs comp comp-cstr warnings icons
subr-x rx cl-seq cl-macs gv cl-extra help-mode bytecomp byte-compile
cconv cl-lib rmc iso-transl tooltip eldoc paren electric uniquify
ediff-hook vc-hooks lisp-float-type elisp-mode mwheel term/x-win x-win
term/common-win x-dnd tool-bar dnd fontset image regexp-opt fringe
tabulated-list replace newcomment text-mode lisp-mode prog-mode register
page tab-bar menu-bar rfn-eshadow isearch easymenu timer select
scroll-bar mouse jit-lock font-lock syntax font-core term/tty-colors
frame minibuffer nadvice seq simple cl-generic indonesian philippine
cham georgian utf-8-lang misc-lang vietnamese tibetan thai tai-viet lao
korean japanese eucjp-ms cp51932 hebrew greek romanian slovak czech
european ethiopic indian cyrillic chinese composite emoji-zwj charscript
charprop case-table epa-hook jka-cmpr-hook help abbrev obarray oclosure
cl-preloaded button loaddefs faces cus-face macroexp files window
text-properties overlay sha1 md5 base64 format env code-pages mule
custom widget keymap hashtable-print-readable backquote threads
xwidget-internal dbusbind inotify lcms2 dynamic-setting
system-font-setting font-render-setting cairo move-toolbar gtk x-toolkit
xinput2 x multi-tty make-network-process native-compile emacs)

Memory information:
((conses 16 106055 14079)
  (symbols 48 7684 0)
  (strings 32 24382 2092)
  (string-bytes 1 692381)
  (vectors 16 16014)
  (vector-slots 8 280598 15332)
  (floats 8 92 262)
  (intervals 56 4484 0)
  (buffers 1008 13))






^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#58980: 29.0.50; Mouse wheel scroll twitches up sometimes when I scroll down
  2022-11-02 16:20 bug#58980: 29.0.50; Mouse wheel scroll twitches up sometimes when I scroll down Mickey Petersen
@ 2022-11-03  8:31 ` Eli Zaretskii
  2022-11-03  9:46   ` Mickey Petersen
  2022-11-03 11:05   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 2 replies; 10+ messages in thread
From: Eli Zaretskii @ 2022-11-03  8:31 UTC (permalink / raw)
  To: Mickey Petersen, Po Lu; +Cc: 58980

> Date: Wed, 2 Nov 2022 16:20:40 +0000
> From: Mickey Petersen <mickey@fyeah.org>
> 
> When I scroll down with my mouse wheel -- typically after an existing 
> window has changed
> buffers, such as after selecting (via keyboard or mouse) an Info manual 
> node --
> the scroll action sometimes (but not always) jerks upwards several
> lines. I can then keep scrolling and it'll start scrolling down
> again. This may sometimes happen after scrolling for a little while, and
> sometimes not at all.
> 
> It's hard to reproduce; but the issue affects a baseline Emacs build (-Q or
> -q) and only sometimes.

Please provide some kind of reproduction recipe, even if it doesn't
happen every time.  When it does happen, type "C-h l", and post the
commands Emacs recorded that you were invoking immediately before the
problem.  Otherwise, it's very hard to do anything about the problem,
unless someone here can reproduce it (I couldn't).

> I had a look in the bug tracker for `scroll' and found nothing. I also
> checked `M-x customize-changed' to look for likely culprits. I found
> nothing that may cause this behaviour, beyond pixel scrolling, which 
> seems like a smoking gun to me,
> but it's off by default in emacs -Q.
> 
> 1. Is it possible there are changes the scrolling code that is active even
> when that mode is not?
> 
> 2. Could there be some sort of variable that determines scroll direction 
> that, somehow, gets confused?

Hard to answer these questions, but maybe Po Lu with have clues.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#58980: 29.0.50; Mouse wheel scroll twitches up sometimes when I scroll down
  2022-11-03  8:31 ` Eli Zaretskii
@ 2022-11-03  9:46   ` Mickey Petersen
  2022-11-03 10:04     ` Eli Zaretskii
  2022-11-03 11:07     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-11-03 11:05   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 2 replies; 10+ messages in thread
From: Mickey Petersen @ 2022-11-03  9:46 UTC (permalink / raw)
  To: Eli Zaretskii, Po Lu; +Cc: 58980



On 03/11/2022 8:31 am, Eli Zaretskii wrote:
>> Date: Wed, 2 Nov 2022 16:20:40 +0000
>> From: Mickey Petersen <mickey@fyeah.org>
>>
>> When I scroll down with my mouse wheel -- typically after an existing
>> window has changed
>> buffers, such as after selecting (via keyboard or mouse) an Info manual
>> node --
>> the scroll action sometimes (but not always) jerks upwards several
>> lines. I can then keep scrolling and it'll start scrolling down
>> again. This may sometimes happen after scrolling for a little while, and
>> sometimes not at all.
>>
>> It's hard to reproduce; but the issue affects a baseline Emacs build (-Q or
>> -q) and only sometimes.
> Please provide some kind of reproduction recipe, even if it doesn't
> happen every time.  When it does happen, type "C-h l", and post the
> commands Emacs recorded that you were invoking immediately before the
> problem.  Otherwise, it's very hard to do anything about the problem,
> unless someone here can reproduce it (I couldn't).
Sure.

I was attempting to reproduce the issue -- by mouse-1 clicking in the 
already-open lossage buffer -- and then I began scrolling _down_ though 
the lossage buffer and it triggered the issue. It instead made me scroll 
up when I was in actual fact scrolling down.
The succession of wheel-up events eventually turned into wheel-down; 
despite the fact that I only scrolled down on my mouse wheel.

Lossage:

  C-h l               ;; view-lossage
  <down-mouse-1>      ;; mouse-drag-region <- I enter the lossage buffer
  <mouse-1>           ;; mouse-set-point
  <down-mouse-1>      ;; mouse-drag-region
  <mouse-1>           ;; mouse-set-point
  <wheel-up>          ;; mwheel-scroll <- I begin scrolling down on my 
physical mouse wheel
  <wheel-up>          ;; mwheel-scroll
  <wheel-up>          ;; mwheel-scroll
  <wheel-up>          ;; mwheel-scroll
  <wheel-up>          ;; mwheel-scroll
  <wheel-down>        ;; mwheel-scroll <- It corrects itself and 
actually starts scrolling down.
  <wheel-down>        ;; mwheel-scroll
  <wheel-down>        ;; mwheel-scroll
  <wheel-down>        ;; mwheel-scroll
  <double-wheel-down> ;; mwheel-scroll
  <triple-wheel-down> ;; mwheel-scroll
  <wheel-down>        ;; mwheel-scroll
  C-h l               ;; view-lossage <- I refresh the lossage.


I _do_, however, have a way that seems to reproduce the issue: when I 
scroll an inactive window and then go back to scrolling the active 
window the bug manifests itself more easily:

1. Ensure there are two windows minimum.
2. Select one.
3. Scroll the other down by hovering over it with your mouse.
4. Now attempt to scroll the active window. Mine will scroll up, and 
trigger "beginning of buffer" user errors if it's already at the top.

Seems there's some stateful behaviour that does or does not get carried 
over when the 'hovered window scroll' changes?


>> I had a look in the bug tracker for `scroll' and found nothing. I also
>> checked `M-x customize-changed' to look for likely culprits. I found
>> nothing that may cause this behaviour, beyond pixel scrolling, which
>> seems like a smoking gun to me,
>> but it's off by default in emacs -Q.
>>
>> 1. Is it possible there are changes the scrolling code that is active even
>> when that mode is not?
>>
>> 2. Could there be some sort of variable that determines scroll direction
>> that, somehow, gets confused?
> Hard to answer these questions, but maybe Po Lu with have clues.






^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#58980: 29.0.50; Mouse wheel scroll twitches up sometimes when I scroll down
  2022-11-03  9:46   ` Mickey Petersen
@ 2022-11-03 10:04     ` Eli Zaretskii
  2022-11-03 11:07     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 10+ messages in thread
From: Eli Zaretskii @ 2022-11-03 10:04 UTC (permalink / raw)
  To: Mickey Petersen; +Cc: luangruo, 58980

> Date: Thu, 3 Nov 2022 09:46:46 +0000
> Cc: 58980@debbugs.gnu.org
> From: Mickey Petersen <mickey@fyeah.org>
> 
> 1. Ensure there are two windows minimum.
> 2. Select one.
> 3. Scroll the other down by hovering over it with your mouse.
> 4. Now attempt to scroll the active window. Mine will scroll up, and 
> trigger "beginning of buffer" user errors if it's already at the top.

Still not reproducible here, sorry.  But I'm not on X, so maybe this
is specific to X Windows.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#58980: 29.0.50; Mouse wheel scroll twitches up sometimes when I scroll down
  2022-11-03  8:31 ` Eli Zaretskii
  2022-11-03  9:46   ` Mickey Petersen
@ 2022-11-03 11:05   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  1 sibling, 0 replies; 10+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-11-03 11:05 UTC (permalink / raw)
  To: Eli Zaretskii; +Cc: Mickey Petersen, 58980

Eli Zaretskii <eliz@gnu.org> writes:

> Hard to answer these questions, but maybe Po Lu with have clues.

I think I can guess what this is: some problem with scroll valuator
tracking.

Mickye, does it still happen with a fresh build from master?  I removed
the valuator reset optimizations that were hitting X server bugs one or
two weeks ago.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#58980: 29.0.50; Mouse wheel scroll twitches up sometimes when I scroll down
  2022-11-03  9:46   ` Mickey Petersen
  2022-11-03 10:04     ` Eli Zaretskii
@ 2022-11-03 11:07     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
       [not found]       ` <0eece511-bacd-2d16-107b-9b9251cc8236@fyeah.org>
  1 sibling, 1 reply; 10+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-11-03 11:07 UTC (permalink / raw)
  To: Mickey Petersen; +Cc: Eli Zaretskii, 58980

Mickey Petersen <mickey@fyeah.org> writes:

> I _do_, however, have a way that seems to reproduce the issue: when I
> scroll an inactive window and then go back to scrolling the active
> window the bug manifests itself more easily:
>
> 1. Ensure there are two windows minimum.

Windows, or frames?

> Seems there's some stateful behaviour that does or does not get
> carried over when the 'hovered window scroll' changes?

No, that shouldn't be it.  Emacs tracks scroll valuators on a
display-local basis, but only gets motion events for the valuator when
the mouse pointer is inside a frame.  As a result, scroll valuators are
reset upon crossing events, as by the time an XI_Enter event arrives,
the stored value can no longer be trusted.

So please answer the question above.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#58980: 29.0.50; Mouse wheel scroll twitches up sometimes when I scroll down
       [not found]                       ` <6980406f-2807-1b7b-86e9-6a0e1b4cc470@fyeah.org>
@ 2022-11-04 11:22                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-11-04 11:28                           ` Mickey Petersen
  0 siblings, 1 reply; 10+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-11-04 11:22 UTC (permalink / raw)
  To: Mickey Petersen; +Cc: 58980

Mickey Petersen <mickey@fyeah.org> writes:

> That did indeed seem to fix the issue, but unfortunately it did seem
> to introduce one minor regression:
>
> When you first scroll a window, it now takes two scrolls of my wheel
> to induce one scroll event in Emacs. After that, it works fine, and
> subsequent 'chains' of up or down scrolls work as expected.
> It's again 'reset' if I try to scroll a different, non-active, window;
> then I must scroll twice in a direction to get Emacs to register a
> scroll event.
>
> Could there be an off-by-one error somewhere?

Luckily, what I said earlier isn't it.  Please test again and see if the
problem is fixed now.

Thanks; BTW, please keep the bug tracker copied in by using "Reply to
All" (or its equivalent in your MUA.)





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#58980: 29.0.50; Mouse wheel scroll twitches up sometimes when I scroll down
  2022-11-04 11:22                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-11-04 11:28                           ` Mickey Petersen
  2022-11-04 11:30                             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  0 siblings, 1 reply; 10+ messages in thread
From: Mickey Petersen @ 2022-11-04 11:28 UTC (permalink / raw)
  To: Po Lu; +Cc: 58980



On 04/11/2022 11:22 am, Po Lu wrote:
> Mickey Petersen <mickey@fyeah.org> writes:
>
>> That did indeed seem to fix the issue, but unfortunately it did seem
>> to introduce one minor regression:
>>
>> When you first scroll a window, it now takes two scrolls of my wheel
>> to induce one scroll event in Emacs. After that, it works fine, and
>> subsequent 'chains' of up or down scrolls work as expected.
>> It's again 'reset' if I try to scroll a different, non-active, window;
>> then I must scroll twice in a direction to get Emacs to register a
>> scroll event.
>>
>> Could there be an off-by-one error somewhere?
> Luckily, what I said earlier isn't it.  Please test again and see if the
> problem is fixed now.
I can confirm that this fix now resolves both the regression and the 
original issue.

I'll keep you posted if I discover any other oddities. (Pixel scroll 
precision mode also works fine, by the way!)

Thanks, Po lu.
>
> Thanks; BTW, please keep the bug tracker copied in by using "Reply to
> All" (or its equivalent in your MUA.)
Oops - thanks!





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#58980: 29.0.50; Mouse wheel scroll twitches up sometimes when I scroll down
  2022-11-04 11:28                           ` Mickey Petersen
@ 2022-11-04 11:30                             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
  2022-11-04 11:31                               ` Mickey Petersen
  0 siblings, 1 reply; 10+ messages in thread
From: Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors @ 2022-11-04 11:30 UTC (permalink / raw)
  To: Mickey Petersen; +Cc: 58980-done

Mickey Petersen <mickey@fyeah.org> writes:

> I can confirm that this fix now resolves both the regression and the
> original issue.
>
> I'll keep you posted if I discover any other oddities. (Pixel scroll
> precision mode also works fine, by the way!)

Thanks for testing.  Please be sure to report any future issues here, as
we want Emacs 29 to be released with wheel movement working everywhere,
including on odd hardware setups that I cannot test myself (my guess is
that you use a trackpad to move the pointer but a mouse wheel to scroll,
or have some integrated keyboard-trackpad device.)

With that, I'm closing this bug.





^ permalink raw reply	[flat|nested] 10+ messages in thread

* bug#58980: 29.0.50; Mouse wheel scroll twitches up sometimes when I scroll down
  2022-11-04 11:30                             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
@ 2022-11-04 11:31                               ` Mickey Petersen
  0 siblings, 0 replies; 10+ messages in thread
From: Mickey Petersen @ 2022-11-04 11:31 UTC (permalink / raw)
  To: Po Lu; +Cc: 58980-done



On 04/11/2022 11:30 am, Po Lu wrote:
> Mickey Petersen <mickey@fyeah.org> writes:
>
>> I can confirm that this fix now resolves both the regression and the
>> original issue.
>>
>> I'll keep you posted if I discover any other oddities. (Pixel scroll
>> precision mode also works fine, by the way!)
> Thanks for testing.  Please be sure to report any future issues here, as
> we want Emacs 29 to be released with wheel movement working everywhere,
> including on odd hardware setups that I cannot test myself (my guess is
> that you use a trackpad to move the pointer but a mouse wheel to scroll,
> or have some integrated keyboard-trackpad device.)
Actually my setup is rather vanilla: desktop mouse with a 'clicky' 
scroll wheel -- as opposed to a smooth-scrolling one -- running Ubuntu 
in a VM. So the mouse hardware is definitely an emulated one as far as 
X/Linux is concerned.
>
> With that, I'm closing this bug.






^ permalink raw reply	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2022-11-04 11:31 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-11-02 16:20 bug#58980: 29.0.50; Mouse wheel scroll twitches up sometimes when I scroll down Mickey Petersen
2022-11-03  8:31 ` Eli Zaretskii
2022-11-03  9:46   ` Mickey Petersen
2022-11-03 10:04     ` Eli Zaretskii
2022-11-03 11:07     ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
     [not found]       ` <0eece511-bacd-2d16-107b-9b9251cc8236@fyeah.org>
     [not found]         ` <87eduke019.fsf@yahoo.com>
     [not found]           ` <af233f63-79d3-2125-9a78-91ef30f55128@fyeah.org>
     [not found]             ` <87y1ssckpe.fsf@yahoo.com>
     [not found]               ` <561adb8a-2f09-9bbd-1c9a-d99098613ed9@fyeah.org>
     [not found]                 ` <87tu3gci00.fsf@yahoo.com>
     [not found]                   ` <138ccba0-9bc5-ad23-c103-fd118caf73ff@fyeah.org>
     [not found]                     ` <87pme3d0mh.fsf@yahoo.com>
     [not found]                       ` <6980406f-2807-1b7b-86e9-6a0e1b4cc470@fyeah.org>
2022-11-04 11:22                         ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-04 11:28                           ` Mickey Petersen
2022-11-04 11:30                             ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors
2022-11-04 11:31                               ` Mickey Petersen
2022-11-03 11:05   ` Po Lu via Bug reports for GNU Emacs, the Swiss army knife of text editors

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).